The biosynthesis of heparan sulfate (HS) 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 of these residues altered the substrate specificities. Our results demonstrate the feasibility of tailoring the specificity of sulfotransferases to modify HS with desired functions.