The invention relates to a preparing method for esomeprazole magnesium. The method comprises esomeprazole magnesium crude product manufacturing steps that 1, omeprazole thioether is synthesized; 2, obtained omeprazole thioether is oxidized under the effects of phthalic anhydride and oxidizing agents to obtain omeprazole, and omeprazole is salinized in a sodium mode to obtain omeprazole sodium; 3, omeprazole sodium is complexed to obtain an omeprazole sodium complex; 4, solvent A,N,N-diethyl ethylamine and 1-phenol acetic acid are added into the omeprazole sodium complex, and the mixture reacts to obtain an esomeprazole sodium complex; 5, alkali, solvent B and purified water are added into the esomeprazole sodium complex, the mixture is stirred for two hours and layered, after an alkaline water layer is acidized, the solvent B is used for extraction, and the mixture is dried and evaporated to dryness in a pressure reducing mode to obtain an esomeprazole magnesium crude product. According to the preparing method, the reaction is mild, the yield is high, and the requirement of esomeprazole magnesium serving as a crude drug can be met; no toxic reagent is needed, and environmental friendliness is achieved; operation is easy, reagents participating in the reaction are common reagents, and cost is controllable.