Zn0.98-xMg0.02BxO nanoparticles with various dopant ratios (x = 0.00 - 0.05 with increments of 0.01) were grown by using the sol-gel technique. The samples were synthesized and the X-ray diffraction, scanning electron microscopy, optical reflectivity, and electron dispersive analyses were used to obtain the structural, electronic, and optical properties, respectively. Williamson- Hall procedure was utilized to obtain structural properties. The energy bandgap of the particles extracted from the absorption spectra was found to be ranging between 3.23 eV and 3.28 eV and decreasing with the boron concentration. The minimum dislocation density delta and Urbach energy E-u and the maximum bandgap E-g were obtained at 1% B concentration. The refractive index calculated by Moss's model was found to be 2.3 and the maximum bandgap energy with a value of 3.28 eV suggests that these materials can be useful for infrared applications.