Sodium borosilicate glasses of the composition 47SiO2–13B2O3–20Na2O–(20–x)CaO–xMgO: x = 0, 5, 10, 15, and 20 mol% named as Mg0, Mg5, Mg10, Mg15, and Mg20, respectively, have been synthesized via melt quenching method. The effect of combined ionic substitutions on composition, physical, linear optical, and photon shielding properties was investigated. The density was decreased from 2.6236 to 2.5155 g cm−3, while the molar volume was decreased from 23.2133 to 22.957 cm3 mol−1 for Mg0 to Mg20. The oxygen packing density and field strength were enhanced with increasing Mg2+ ion content. Therefore, the glass structure’s rigidity was supported by the decrease in internuclear distance and polaron radius values with increased dopant ion concentration. The optical energy gap was increased from 3.24 to 3.35 eV, and the refractive index from 2.335 to 2.309 for Mg0 to Mg15 glasses. The linear attenuation coefficient of the proposed Mg0-Mg20 glasses obeys the trend (Mg20)LAC < (Mg15)LAC < (Mg10)LAC < (Mg5)LAC < (Mg0)LAC, while the mean free path obeys the trend (Mg0)MFP < (Mg5)MFP < (Mg10)MFP < (Mg15)MFP < (Mg20)MFP. The half value layer (HVL) of Mg0 ranged from 0.034 to 12.546 cm, while Mg20 ranged from 0.061 to 13.714 cm at 0.015 and 15 MeV. The transmission factor was found 43.713% and 75.864% at 5-cm glass thickness and increased to reach 85.35267% and 95.07127% at 1-cm glass thickness at 1 MeV and 15 MeV, respectively. The suggested glasses can be applied in optical devices and radiation protection applications.