Essential bifunctional enzyme that catalyzes both the N-deacetylation and the N-sulfation of glucosamine (GlcNAc) of the glycosaminoglycan in heparan sulfate (PubMed:9230113, PubMed:9744796, PubMed:35137078). Modifies the GlcNAc-GlcA disaccharide repeating sugar backbone to make N-sulfated heparosan, a prerequisite substrate for later modifications in heparin biosynthesis (PubMed:9230113). 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 (PubMed:22660413). Lacks both N-deacetylase and N-sulfotransferase activities. Acts as a dominant negative on isoform 1, likely by changing the composition of enzyme complexes responsible for elongation and modification of heparan sulfates. 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) Glycan metabolism; heparan sulfate biosynthesis. Glycan metabolism; heparin biosynthesis. Monomer. Interacts with heparan sulfate co-polymerase subunits EXT1 and EXT2. Interacts with NDST1 isoform 3. Interacts with heparan sulfate co-polymerase subunits EXT1 and EXT2. Interacts with NDST1 isoform 1. Widely expressed. Expression is most abundant in heart, liver and pancreas. The disease is caused by variants affecting the gene represented in this entry. 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. The increased expression in several types of cancer is associated with shorter survival. Belongs to the sulfotransferase 1 family. NDST subfamily.