The present invention provides a method of producing a heparan sulfate having an anticoagulant activity. Specifically, the present invention provides the method of producing a heparan sulfate having a desired molecular weight, by partially N-deacetylating a heparosan followed by low-molecularizing the same by heparinase III, and converting a produced low molecular weight product into the heparan sulfate having the anticoagulant activity.