To meet the demand of the future high energy, high voltage, high frequency, high temperature and high power electronic devices, the improvement of wide band gap is very significance for the applications of the third generation semiconductor material. To improve the band gap of GaN, the influence of B-doped concentration on the electronic and optical properties of GaN semiconductor is studied by the first-principles method. Four B-doped concentrations (3.125 at%, 6.25 at%, 12.5 at% and 25 at %) are investigated. The calculated results show that these B-doped GaN are thermodynamic stability because of the negative doped formation energy. In particular, the thermodynamic stability of the B-doped GaN becomes better with increasing B concentration. Importantly, the band gap follows the order of 25 at% B-doping > 12.5 at% B-doping > 6.25 at% B-doping > 3.125 at% B-doping > GaN. The band gap of 25 at% B-doped GaN increases about 70 % compared to GaN. Essentially, the B-doping induces the conduction band to move from the EF to the high energy region, which enhances the difficult of electronic transfer between the valence band and conduction band near the Fermi level. The semiconductor properties of the B-doped GaN are demonstrated by the dielectric functional. In addition, the B-doping is beneficial to improve the storage optical properties of GaN. Therefore, we believe that the B-doping can improve band gap and optical properties of GaN, which is potentially used in the high power, high voltage, low loss devices and deep ultraviolet optoelectronics.