In this research, the structural and optical properties of polyaniline hydrochloride (PANI) and its nanocomposites (PANI-Cu) (using different added Cu %) were prepared and studied. This study was confirmed by X-ray diffraction, as the results showed that the prepared materials have a polycrystalline structure. The optical properties were also diagnosed by measuring the absorbance spectrum in the range of wavelengths (200–800 nm) for polyaniline hydrochloride and nanocomposite (PANI-Cu). The absorption coefficient and the optical energy gap were also calculated, and the results showed that the polymer possesses a permissible direct energy gap and that it decreases differently by increasing the deformation ratios of (Cu) within the optical energy gap. Furthermore, the results showed that the lowest energy gap was obtained at the deformation ratio (5% Cu) and the energy gap value was at this ratio was equal to (3.1ev), where a coup point was observed in all measurements at the ratio (5% Cu).