Conducting polyaniline (PANI)/cadmium sulfide (CdS) nanocomposite films were prepared by in situ chemical oxidation method. The prepared nanocomposites were characterized by fourier transform infra‐red spectroscopy, X‐ray diffraction, and scanning electron microscopy for structural and morphological analysis. The effect of CdS content on structural and morphological features of PANI matrix are discussed in detail. The frequency dependent room temperature conductivity and dielectric properties of these composites were studied by measuring various parameters in the frequency range 10–106 Hz. The role of surface modification on electrical and dielectric properties of the composites was analyzed and it was found that, the concentration of CdS in PANI matrix has a greater influence on electrical properties due to the alteration of molecular chains in PANI matrix. Among various nanocomposites so prepared, the composite with 3 wt% of CdS in PANI matrix (P3) shows better conductivity and dielectric behavior which could be of great importance in various technological applications. The possibility of these materials being used as transistors, energy storage and nano dielectric devices could be explored further. POLYM. COMPOS., 40:E579–E588, 2019. © 2018 Society of Plastics Engineers