Abstract Thin films of Sm3+ ions doped ZnO were prepared by dip coating method. To enhance the oxygen vacancy in the host ZnO lattice and obtain crystallinity, the thin films were annealed at 400 °C for 2 h in air. X-ray diffractions (XRD) study displays the hexagonal wurtzite structure of ZnO with crystallite size in the range of 27.37–24.21 nm. The induced carrier concentration, intrinsic defects and oxygen vacancies produced a blue shift in the band gap (Eg) with an increase in Sm doping percentage. The surface morphology is granular with slight agglomeration. Thin films have shown violet photoluminescence. The emissions intensity can be tailored by increasing the Sm percentage which is due to the increase in defect concentration as well as find application in optoelectronic devices. Room temperature ferromagnetism is recorded in the thin films. Hysteresis show that 1 at. wt. % Sm doped ZnO has larger saturation magnetization than 5 at. wt. % Sm doped thin films. The work has established that rare earth element doping in ZnO produces diluted magnetic semiconductors which can be part of absorber layer of solar cell, to store data in memory devices and optoelectronics applications. Antibacterial studies were conducted for Staphylococcus aureus (S. Aureus), klebsiella pneumonia (K. B), Pseudomonas aeruginosa (P. aeruginosa) and Escherichia coli (E. coli) bacterial strains by applying the agar well diffusion method to suspension containing undoped ZnO and Sm doped ZnO nanoparticles. The enhancement in the zone of inhibition with an increase in samarium exhibits high antibacterial activity. The results predict that Sm doped ZnO is a good possibility of food packing, removal of the tumor, treatment of pneumonia and a diagnosis of malign diseases.