The invention discloses a method for preparing halogenated sugars under mild conditions. The halogenated sugars (chlorine, bromine and iodine) can be obtained by reacting an easily prepared glucosinolate donor with a halogen element or an interhalogen compound at room temperature. . The halogen element and the inter-halogen compound described therein are iodine element, iodine bromide and iodine chloride, which are readily available commercially. This method is applicable to all kinds of pyranose and furanose. And this method has no limitation on the protecting group of the glucosinolate donor, which can be an electron withdrawing group such as acetyl group, benzoyl group, etc., or an electron donating group such as benzyl group, silicon group, etc. At the same time, the reaction can occur in various organic solvents such as dichloromethane, acetonitrile, and toluene. The preparation method of the halogenated sugar of the present invention is simple, the reaction conditions are mild, the raw materials are readily available, the application range is wide, the halogenated sugar is compatible with acid-labile groups such as isopropylidene ketal and silicon groups, and is unstable in the separation process. The halogenated sugar can be purified by removing the solvent.