The invention relates to a method for preparing high-purity esomeprazole magnesium. The method comprises the following steps: mixing omeprazole sulfide, diethyl tartrate and titanium isopropoxide, adding diisopropylethylamine, performing stirring, dropping cumene hydroperoxide, and performing separation so as to obtain an oil substance; adding a strong base, performing stirring, adding the strongbase time by time, performing extraction and washing, performing TLC (thin-layer chromatography) monitoring, and stopping adding the strong base when trace points are generally vanished; performing cooling, crystal separation, filtration and leaching so as to obtain an esomeprazole salt; dissolving the esomeprazole salt with water, reducing the temperature to 20 DEG C or less, adjusting the pH value, dropping a magnesium sulfate heptahydrate solution, and after dropping, performing stirring, filtration, leaching and drying so as to obtain a crude product of esomeprazole; dissolving the crude product of the esomeprazole with methanol, performing decoloring with activated carbon, performing filtration, concentration and secondary dissolution, adding an acetone solution, and performing stirring, suction filtration and drying, so as to obtain the esomeprazole magnesium. The product prepared by using the method is high in purity, high in yield and small in impurity.