β-N-Acetylgalactosamine-containing glycans play essential roles in several biological processes, including cell adhesion, signal transduction, and immune responses. β-N-Acetylgalactosaminidases hydrolyze β-N-acetylgalactosamine linkages of various glycoconjugates. However, their biological significance remains ambiguous, primarily because only one type of enzyme, exo-β-N-acetylgalactosaminidases that specifically act on β-N-acetylgalactosamine residues, has been documented to date. In this study, we identify four groups distributed among all three domains of life and characterize eight β-N-acetylgalactosaminidases and β-N-acetylhexosaminidase through sequence-based screening of deep-sea metagenomes and subsequent searching of public protein databases. Despite low sequence similarity, the crystal structures of these enzymes demonstrate that all enzymes share a prototype structure and have diversified their substrate specificities (oligosaccharide-releasing, oligosaccharide/monosaccharide-releasing, and monosaccharide-releasing) through the accumulation of mutations and insertional amino acid sequences. The diverse β-N-acetylgalactosaminidases reported in this study could facilitate the comprehension of their structures and functions and present evolutionary pathways for expanding their substrate specificity.