Pristine (pure) ZnO and Zn1−xFexO (with Fe = 0.05, 0.10, and 0.15) nanoparticles (NPs) were successfully prepared by green synthesis using aloe vera gel. The x‐ray diffraction (XRD), Field emission scanning electron microscope, ultraviolet‐visible, photoluminescence (PL), and vibrating sample magnetometer (VSM) were employed to investigate the structural, optical, and magnetic properties of Zn1−xFexO NPs. Rietveld refined XRD data revealed that Zn1−xFexO NPs have hexagonal wurtzite structures with space group P63mc. Fe‐doping resulted in a decrease in the average grain size. The value of the Eg decreased from 2.49 to 2.17 eV with an increase in Fe3+ content. A blue shift in band edge emission shift toward lower wavelength (x = 0.00 to 0.05) and red‐shift for (x > 0.05) PL spectra. A ferromagnetic behavior with enhancement in saturation magnetization was observed with Fe3+ doping. By breaking down the bacterial cell wall and altering the genetic makeup of the cells, Zn1−xFexO NPs effectively eradicate Klebsiella pneumonia and Staphylococcus aureus in antimicrobial assessment.