Carbohydrate recognition is essential for growth, cell adhesion and signalling in all living organisms. A highly conserved carbohydrate binding module, LysM, is found in proteins from viruses, bacteria, fungi, plants and mammals. LysM modules recognize polysaccharides containing N-acetylglucosamine (GlcNAc) residues including peptidoglycan, an essential component of the bacterial cell wall. However, the molecular mechanism underpinning LysM-peptidoglycan interactions remains unclear. Here we describe the molecular basis for peptidoglycan recognition by a multimodular LysM domain from AtlA, an autolysin involved in cell division in the opportunistic bacterial pathogen Enterococcus faecalis. We explore the contribution of individual modules to the binding, identify the peptidoglycan motif recognized, determine the structures of free and bound modules and reveal the residues involved in binding. Our results suggest that peptide stems modulate LysM binding to peptidoglycan. Using these results, we reveal how the LysM module recognizes the GlcNAc-X-GlcNAc motif present in polysaccharides across kingdoms.