The invention discloses magnesium, calcium and sulfur containing 20MnCr free-cutting gear steel and a preparation method thereof. The steel is prepared from, by weight percent, 0.15%-0.25% of C, not larger than 0.12% of Si, 0.80%-1.50% of Mn, not larger than 0.035% of P, 0.02%-0.055% of S, 0.80%-1.30% of Cr, 0.015%-0.055% of Al, 0.004%-0.015% of N, 0.0006%-0.004% of Mg, 0.0006%-0.005% of Ca, not larger than 0.0025% of [O] and the balance iron and inevitable impurities. Composite modification is carried out on inclusion by adding a small quantity of calcium and magnesium elements in the refining process, and the composite inclusion with oxide (including multiple oxide) as a core is formed, wherein the core of the composite inclusion is wrapped by sulfide; splitting of the oxide to a steel substrate can be relieved, the anti-fatigue performance can be improved, and the transverse mechanical property of the steel can be improved; and the magnesium, calcium and sulfur containing 20MnCr free-cutting gear steel both good in mechanical performance and cutting performance is produced, and has large economic benefits.