Glycosaminoglycans, particularly heparin and heparin fragments, were specifically O-acetylated by use of tetrabutylammonium or tributylammonium salts of the anionic polysaccharides, carboxylic acid anhydrides, and 4-dimethylaminopyridine in an homogeneous way in N,N-dimethylformamide. The number of acyl chains introduced on the carbohydrate backbone was determined either after transesterification and quantitative analysis of the butyl esters thus obtained by GLC or by H-1 NMR spectroscopy.