This correspondence presents a radically distinctive approach for preparing conducting polymer polyaniline–polystyrene (PANI–PS) blends doped with HCl by an in situ dispersion polymerization method. Generally, there are two prerequisites for choosing the blended polymers: good compatibility with PS molecules and comparatively high electrical conductivity. Therefore, we use different monomer ratios of PS keeping the aniline concentration constant while preparing the five blends. The blend films, cast on glass substrates, are characterized by various studies such as SEM (for morphology), XRD (for crystallinity), FTIR chemical interaction, DSC, and TGA thermal properties. Subsequently, the electrical properties are studied using I–V characteristics and four probe conductivity measurements. The SEM results of the above polymerized blends reflect the formation of spherical nanoparticles with diameter ranging from 50nm to 90nm with a decrease in PS concentration that facilitates the formation of clusters. Furthermore, the XRD diffractograms show semi crystalline behavior of the blend films where crystallinity decreases with decreasing PS concentration. The FTIR spectra establish a new peak in the blend films other than the peaks found in PANI and PS films indicating possible chemical crosslinking between the polymers. It can be observed that the increase in PS concentration increases the intensity of the peak. The TGA of the polymer blends reveals five-step degradation including four due to the pure polymer and one due to the blend formation. The decomposition temperature is found to be more for blend film than that of pure PANI but less than PS decomposition. The DSC results display a peak, each for water and oxidation of the polymer blend, but do not contain any such for PANI. From DSC data, it is clear that the blend film exhibits the combined physical properties of both the polymer components. The non-ohmic behavior of I–V characteristics by the blend films indicates that these nanocomposite films may have some utility in electronic device applications; an increase in conductivity is observed with decreasing PS concentration. Finally, the blend films with high conductivity seem to have good sensitivity and reversibility when used as CO2 sensors.