In this study, multiwall carbon nanotubes (MWCNTs)/polyaniline nanocomposites deposited on ITO coated glass as substrate by the spin-coating technique were applied to the investigation of the effect of different contents of MWCNTs on the optical and electrical properties of polyaniline. Micrographs from an atomic force microscope were taken to analyze the 3-D microtexture parameters of surface texture factors and fractal dimension. By using optical spectroscopy of samples with different concentrations of MWNCTs in visible and ultraviolet regions, the transmission variations vs photon wavelength, optical bandgap, absorption coefficient, and skin depth were studied. The variation in the resistance of nanocomposite films exposed to 0.4 %vol of H2 gas at room temperature was monitored, and the results indicated that the sensitivity and responsibility of the composites increased with an increase in the MWCNT amount.