The biosynthesis of heparan sulfate (HS), an essential glycan in many organisms, involves an array of specialized sulfotransferases. Here, we present a study aimed at engineering the substrate specificity of different HS 3-O-sulfotransferase isoforms. Based on the crystal structures, we identified a pair of amino acid residues responsible for selecting the substrates. Mutations at these residues altered the substrate specificities. Our results demonstrated the feasibility of tailoring the specificity of sulfotransferases to modify HS with desired functions