Nanocomposites were prepared by the method of solution casting with different proportions of magnesium oxide nanoparticles (0, 1, 3, 5, 7 and 9) wt%. The structural and optical properties of nanocomposites of CMC/MgO have been studied. It was well known that the increased content of MgONPs in the method contributes to the peaks of MgONPs being completely integrated and/or disappearing within the CMC diffraction halos in the experimental results of XRD study. The differences in the XRD spectrum indicate that doping with nanoparticles induced a disparity in the microstructure of the polymer. Nanocomposite film scanning electron microscopy (SEM) reveals that MgONPs appear to form aggregates and scatter well in (CMC/MgO) nanocomposite films and at apply 9 wt. It forms a continuous network within the polymer for the percentage of MgONPs to (CMC) polymer. FTIR spectrum revealed the MgONPs has no destructive influence on the polymer structure as no covalent bonds formed between CMC and MgONPs. The optical properties of CMC/MgO nanocomposites were measured in wavelength range (200–900) nm. Experimental studies have shown that the absorbance, absorption coefficient, extinction coefficient, refractive index, actual and imaginary dielectric constant of CMC polymer is improved with an increase in concentrations of MgONPs in nanocomposites. The transmittance and energy gap of CMC polymer are decreased with the increase in the concentrations of MgONPs.