Essential bifunctional enzyme that catalyzes both the N-deacetylation and the N-sulfation of glucosamine (GlcNAc) of the glycosaminoglycan in heparan sulfate. Modifies the GlcNAc-GlcA disaccharide repeating sugar backbone to make N-sulfated heparosan, a prerequisite substrate for later modifications in heparin biosynthesis. Has high deacetylase activity but low sulfotransferase activity. 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. Strongly expressed strongly in brain. Expressed at high level at embryonic day 11 compared to other stages of development. Weakly expressed in adult heart, kidney, muscle, endothelial cells and testis but not in other tissues. 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.