A convenient and efficient method for selective replacement of the primary hydroxyl groups of sugars by chlorine with concomitant O-formylation, compatible with the presence of a variety of functional groups, has been developed using the Vilsmeier–Haack reaction. Sugars having free primary hydroxyl groups mostly afforded the chloro-O-formylated product while sugars devoid of primary hydroxyl groups