Developing sustainable and green packaging products that protect foods and preserve their unique properties from UV radiation, which causes photochemical damage, is one of the extensive challenges in the food-packaging industry. Accordingly, carboxymethyl cellulose sodium (CMC)/graphene (G) nanocomposites that contained different weight percentages were prepared by a mechanical milling method. The influence of the G on the chemical composition and optical properties of the nanocomposites were studied by different techniques. SEM and FT-IR analyses confirmed the interaction between the CMC and G. The XRD spectrum showed that the crystallite size of the CMC decreased with G addition. The findings showed that changing the G concentration modified the CMC's optical properties. The CMC's transmittance decreased to 52%, 49%, and 57% in the UV-C (200-280), UV-B (280-320 nm), and UV-A (320-400) regions, respectively, with the addition of 2 wt.% of G. Moreover, the optical band gap decreased to 4.80 eV, while the Urbach energy increased from 0.34 to 0.94 eV as the G content increased. The density functional theory (DFT) assumption was followed to establish the electronic properties and vibrational spectrum of the CMC/G model. The theoretically determined IR and experimental FT-IR spectra of the CMC/G nanocomposites showed good agreement. The obtained results show that these nanocomposites are good candidates for food packaging.