Using hybrid density functional theory, we investigate the structural, electronic and optical properties of pristine GaN and Fe-doped GaN with a Fe concentration of 12.5%. Specifically, we first analyze the crystal lattice constant, band structure, and density of states, respectively. Then we predict the dielectric function, absorption coefficient, refractive index, reflectivity, energy-loss spectrum and extinction coefficient. Finally, we analyze the influences of the doping of Fe element on the photoelectric property of Fe doped systems. The calculated lattice constants for perfect GaN are a=b=3.19 Å, c=5.18 Å, which are in good agreement with the experimental values. Furthermore, we find that the doping of Fe element has little effect on the structural properties of GaN. The Band gap of pristine GaN is predicted to be 3.41 eV, very close to the experimental value of 3.39 eV. The band gap of Fe doped GaN (12.5%) significantly decreases to 3.06 eV. By comparing the densities of states of the systems with and without Fe doping, it is found that Fe-3 d state is mainly responsible for the decrease of band gap. The calculated static dielectric constant of perfect GaN is 5.74, and it increases to 6.20 after incorporating the Fe element. The results about the imaginary part of dielectric function show that two equal-strength perfect GaN peaks are observed to be at 6.81 eV and 10.85 eV. The first peak is closely related to the direction transition from the valence band top to the conduction band bottom. Furthermore, it is also observed that a peak is located at 4.04 eV in the low energy, which can be understood as resulting from the electron transition inside the valence band. The optical absorption edge of the intrinsic GaN is 3.25 eV, corresponding to the transition energy. The reason why this energy is smaller than the bandgap is because the electronic band gap equals the sum of optical bandgap and exciton energy. However, the maximum absorption coefficients of these two systems both occur at 13.80 eV in energy. The refractive index for intrinsic system is 2.39, and it increases to 2.48 after doping the Fe element. It is found from the energy-loss spectrum that the maximum energy-loss is at 20.02 eV for a perfect system, while it is at 18.96 eV for a doped system. Additionally, we obtain the reliable reflectivity and excitation coefficient. In conclusion, our calculated results provide a well theoretical basis for the theoretical research on the co-doping of Fe element and other elements. The analyses on the Fe-doped GaN high-voltage photoconductive switch materials and devices also provide a powerful theoretical basis and experimental support in the future research.