Dirt and microorganisms are the major problems in textiles which can generate unpleasant odor during their growth. Here, zinc oxide (ZnO) nanoparticles prepared by sol-gel method were loaded on the cotton fabrics using spin coating technique to enhance their antimicrobial properties and water repellency. The effects of ZnO precursor concentration, precursor solution pH, number of coating runs, and Mg doping percent on the structures, morphologies, and water contact angles (WCA) of the ZnO-coated fabrics were addressed. At 0.5 M concentration and pH7, more homogeneous and smaller ZnO nanoparticles were grown along the preferred (0 0 2) direction and uniformly distributed on the fabric with a crystallite size 17.98 nm and dislocation density 3.09 × 10−3 dislocation/nm2. The substitution of Zn2+ with Mg2+ ions slightly shifted the (002) peak position to a higher angle. Also, the zeta potential and particle size distribution were measured for ZnO nanoparticle suspension. A superhydrophobic WCA = 154° was measured for the fabric that coated at 0.5 M precursor solution, pH 7, 20 runs and 0% Mg doping. Moreover, the antibacterial activities of the ZnO-coated fabric were investigated against some gram-positive and gram-negative bacteria such as Salmonella typhimurium, Klebsiella pneumonia, Escherichia coli, and Bacillus subtilis.