In this study, a novel conductive hydrogel nanocomposite (CHN) was prepared using chemical oxidative polymerization of aniline (AN), acrylic acid (AA), and acrylamide (AM) and subsequent in situ synthesis of silver nanoparticles. The structure of CHNs was characterized by Fourier transform infrared, scanning electron microscopy, Transmission electron microscopy, EDX, X‐ray diffraction, and UV‐Vis analysis techniques and a proposed mechanism for the preparation of CHNs was also suggested. The maximum water‐swelling capacity (78 g g−1) was achieved under the optimum conditions that found to be: AA = 0.2 mol L−1, AM = 0.18 mol L−1, AN = 0.1 mol L−1, swelling time = 180 min, and temperature = 25°C. In addition, the effect of reaction parameters were studied with respect to the percent of impregnated poly(AN) within nanocomposites. Further, the electrical conductivity of CHN samples was found to be increased with the increase in AN content and temperature whose conductivity lies in the range 2.1 to 8.8 × 103 S cm−1. The temperature dependence of electrical conductivity indicates that composites follow Arrhenius model. Moreover, the synthesized CHNs demonstrated an antibacterial action against Gram‐negative Escherichia coli bacterium. In conclusion, durable antibacterial and electrically conductive CHNs can be suitable for different types of applications in many fields i.e. in biological systems, wound dressing, catalysis, water purification, and flexible electrodes for supercapacitors. POLYM. COMPOS., 40:2724–2733, 2019. © 2018 Society of Plastics Engineers