We present a novel approach to preparing non-toxic sunscreen active ingredients by electron irradiation of poly(methyl methacrylate) (PMMA) and polystyrene (PS) nanoparticles (NPs). Electron irradiation modifies the molecular structure of the polymers, generating conjugated aliphatic carbon–carbon double bonds in PMMA and conjugated aromatic rings in PS. The conjugation length increases as the electron fluence increases, leading to hyperchromic and bathochromic shifts in the UV-vis absorption spectra of the irradiated polymer NPs. Consequently, the irradiated polymer NPs become capable of UV absorption and the UV-absorbing properties are improved with increasing electron fluence. The UV-screening performance of the electron-irradiated polymer NPs are found to be superior to those of commercially available sunscreen ingredients. In addition, in vitro cytotoxicity and phototoxicity test results show that the irradiated polymer NPs exhibit excellent biocompatibility.