Essential bifunctional enzyme that catalyzes both the N-deacetylation and the N-sulfation of glucosamine (GlcNAc) of the glycosaminoglycan in heparan sulfate (PubMed:1379236, PubMed:3422231, PubMed:8483907, PubMed:9890952). Modifies the GlcNAc-GlcA disaccharide repeating sugar backbone to make N-sulfated heparosan, a prerequisite substrate for later modifications in heparin biosynthesis (PubMed:1379236, PubMed:3422231). Plays a role in determining the extent and pattern of sulfation of heparan sulfate. Participates in biosynthesis of heparan sulfate that can ultimately serve as L-selectin ligands, thereby playing a role in inflammatory response (By similarity). Required for the exosomal release of SDCBP, CD63 and syndecan (By similarity). H2O + N-acetyl-alpha-D-glucosaminyl-[heparan sulfate](n) = acetate + alpha-D-glucosaminyl-[heparan sulfate](n) 3'-phosphoadenylyl sulfate + alpha-D-glucosaminyl-[heparan sulfate](n) = adenosine 3',5'-bisphosphate + 2 H(+) + N-sulfo-alpha-D-glucosaminyl-[heparan sulfate](n) The deacetylase activity is specifically inhibited by N-Ethylmaleimide (PubMed:8483907). The sulfotransferase activity is specifically inhibited by 3',5'-ADP (PubMed:8483907). Glycan metabolism; heparan sulfate biosynthesis. Glycan metabolism; heparin biosynthesis. Monomer. Interacts with heparan sulfate co-polymerase subunits EXT1 and EXT2. The presence of 4 different heparan sulfate N-deacetylase/N-sulfotransferase enzymes in mammals, as well as differences in their enzyme activity suggest that some initiate heparan sulfate modification/sulfation reactions, whereas other later on fill in or extend already modified heparan sulfate sequences. Belongs to the sulfotransferase 1 family. NDST subfamily.