Catalyzes the cleavage of beta-N-acetylglucosaminides and beta-N-acetylgalactosaminides. Also catalyzes the hydrolysis of N-acetylchitooligomers. May be involved in chitin degradation. It is not able to cleave beta-glucosides. Hydrolysis of terminal non-reducing N-acetyl-D-hexosamine residues in N-acetyl-beta-D-hexosaminides. There is a 4-fold greater activity on 4'-nitrophenyl beta-N-acetyl-D-glucosaminide than on 4'-nitrophenyl beta-N-acetyl-D-galactosaminide. Optimum pH is 7.3-8.7 with 4'-nitrophenyl beta-N-acetyl-D-glucosaminide as substrate. Rapidly inactivated above pH 9.5 and stable from pH 6.0 to 9.5. Glycan degradation; chitin degradation. The reaction mechanism involves an oxazolinium ion intermediate. Belongs to the glycosyl hydrolase 20 family.