Capped and uncapped zinc sulphide (ZnS) nanoparticles (NPs) were successfully synthesized from used Zn–C battery, while surface was modified with capping agent 1-(carboxymethyl)-4-[(E)-2-(1,2-oxazol-3-yl)ethenyl]pyridin-1-ium. The structural properties of synthesized NPs were investigated using scanning electron microscope, energy-dispersive X-ray spectroscopy, powder X-ray diffraction (XRD), Fourier transform infrared and UV–visible spectroscopy. From XRD studies, cubic zinc blend structure for all the NPs was confirmed, and the crystallite size for uncapped and dye-capped NPs were calculated as 18.1 and 15.2 nm from Scherrer’s equation. Quantum espresso software was used to carry out the density functional theory calculations of dye. These dye-capped ZnS NPs proved to be excellent antibacterial agents and the minimum concentrations of pure ZnS and dye-capped ZnS NPs, which restrain the growth of bacteria, were found to be 0.312 and 0.156 mg ml−1 for S. typhi and 1.25 and 0.625 mg ml−1 for B. subtilis, respectively. The bioactivity data suggest that these organic–inorganic hybrid NPs appeared to be a new class of antibacterial agents.