One of the suitable methods for removing heavy metals from water and waste water is the use of a surface adsorption process. In this study, polyaniline/polystyrene (PAn/PS) nanocomposite was prepared in aqueous solution by the polymerization of styrene and aniline using potassium iodate and ammonium peroxydisulfate as oxidants in the presence of surfactive dopant sodium dodecylbenzenesulfonate and poly(vinyl pyrrolidone) as surfactant. The capability of separating Cd(II) ions was studied, and the results were compared with those obtained with other adsorbents. The results indicated that removal percentage was increased by increasing the concentration of adsorbent, contact time, and the pH of the solution