This paper describes the discovery and characterization of two novel β-N-acetylhexosaminidases HEX1 and HEX2, capable of catalyzing the synthesis of human milk oligosaccharides (HMO) backbone structures with fair yields using chitin oligomers as β-N-acetylglucosamine (GlcNAc) donor. The enzyme-encoding genes were identified by functional screening of a soil-derived metagenomic library. The β-N-acetylhexosaminidases were expressed in Escherichia coli with an N-terminal His6-tag and were purified by nickel affinity chromatography. The sequence similarities of the enzymes with their respective closest homologues are 59 % for HEX1 and 51 % for HEX2 on the protein level. Both β-N-acetylhexosaminidases are classified into glycosyl hydrolase family 20 (GH 20) are able to hydrolyze para-nitrophenyl-β-N-acetylglucosamine (pNP-GlcNAc) as well as para-nitrophenyl-β-N-acetylgalactosamine (pNP-GalNAc) and exhibit pH optima of 8 and 6 for HEX1 and HEX2, respectively. The enzymes are able to hydrolyze N-acetylchitooligosaccharides with a degree of polymerization of two, three, and four. The major findings were, that HEX1 and HEX2 catalyze trans-glycosylation reactions with lactose as acceptor, giving rise to the human milk oligosaccharide precursor lacto-N-triose II (LNT2) with yields of 2 and 8 % based on the donor substrate. In total, trans-glycosylation reactions were tested with the disaccharide acceptors β-lactose, sucrose, and maltose, as well as with the monosaccharides galactose and glucose resulting in the successful attachment of GlcNAc to the acceptor in all cases.