Polyaniline (PANI) salt in its pure and doped forms find extensive applications in making devices such as polymer light emitting diodes, photovoltaic, sensors, batteries, and super capacitors. PANI salt has been synthesized successfully through chemically oxidative polymerization of aniline in the presence of hydrochloric acid (HCl) and sulfuric acid (H2 SO4 ) using ammonium peroxydisulfate as an oxidizing agent. The absorption spectra of pure PANI salt and its doped state, in HCl and H2 SO4 media, have been studied in the wavelength range from 200 to 1100 nm using ultraviolet and visible near infrared spectrophotometer. Tauc’s formula, Lambert-Beer’s relation, and Fresnel’s formula were employed in the MATLAB program to calculate the optical energy gap, refractive index, and dielectric constant. Results showed that doping with HCl and H2 SO4 acidic mediums caused a reduction in the direct energy gap of the pure PANI from 2.69eV to 2.42 eV and 2.54 eV, respectively. The reduction in optical energy gap is associated with the increase in refractive index. The refractive index (2.92) has a higher value of PANI doped with HCl. Higher refractive index values are for better-structured films.