The polyaniline was doped with sulfonic acid and functionalized with single-walled carbon nanotubes. The effects of single-walled carbon nanotubes (SWCNTs) inserting and thermal annealing at T = 393 K, during 24 h are carried out by optical and structural study. Structural characterizations of D-polyaniline (PANI) or D-PANI/SWCNTs compounds at both pristine and annealed states were obtained by Fourier Transform infrared analysis and scanning and transmission electron microscopies. Optical parameters including absorption coefficient, optical transition type, energy gaps, skin depth, and extinction coefficient have been also elucidated from optical absorption measurements. Moreover, the characteristics of the localized states introduced either by SWCNTs adding and/or annealing temperature are carried out. By referring to the starting material, the direct (indirect) optical band gap was found to be reduced from 3.91 (3.75) to 2.35 (2.24) eV, after SWCNTs inserting and annealing. Moreover, new localized states having a band width of 390 meV are created at 1.25 eV. The SWCNTS dispersion quality on the organic matrix and the PANI self-crosslinking lead to the charge transfer and the resulting interpenetrating network can be used as active layers for organic solar cells. POLYM. COMPOS., 40: E821-E831, 2019.