The invention provides a non-irritant contraceptive gel with a function of inhibiting bacteria and a preparation method thereof, relates to contraceptive gel and a preparation method thereof, and aims to improve the nonoxinol spermicidal effect and solve the problem of side effect caused when existing nonoxinol is used for killing sperms. The gel is prepared from the following main components: chlorhexidine acetate, aloe gel, nonoxinol, pomegranate powder, turmeric extract and platycodin D. The method comprises the following steps of: 1, adding water into Carbomer to swell to obtain a Carbomer solution; regulating the pH value to obtain gel; 2, dissolving aloe gel with water to obtain aloe gel solution; and 3, adding ethanol and tween 80 into chlorhexidine acetate, uniformly stirring to obtain a mixed solution, adding pure water, uniformly stirring, adding into gel and nonoxinol to obtain mixture; and 4, adding pomegranate powder, turmeric extract and platycodin D, and uniformly mixing to obtain a contraceptive gel. The contraceptive gel has a good sperm killing effect, does not have side effect if being used for a long time, and is used in the field of contraceptive medicines.