Carbapenemase and extended β-lactamase-producing Klebsiella pneumoniae isolates represent a major health threat, stimulating increasing interest in immunotherapeutic approaches for combating Klebsiella infections. Lipopolysaccharide O antigen polysaccharides offer viable targets for immunotherapeutic development, and several studies have described protection with O-specific antibodies in animal models of infection. O1 antigen is produced by almost half of clinical Klebsiella isolates. The O1 polysaccharide backbone structure is known, but monoclonal antibodies raised against the O1 antigen showed varying reactivity against different isolates that could not be explained by the known structure. Reinvestigation of the structure by NMR spectroscopy revealed the presence of the reported polysaccharide backbone (glycoform O1a), as well as a previously unknown O1b glycoform composed of the O1a backbone modified with a terminal pyruvate group. The activity of the responsible pyruvyltransferase (WbbZ) was confirmed by western immunoblotting and in vitro chemoenzymatic synthesis of the O1b terminus. Bioinformatic data indicate that almost all O1 isolates possess genes required to produce both glycoforms. We describe the presence of O1ab-biosynthesis genes in other bacterial species and report a functional O1 locus on a bacteriophage genome. Homologs of wbbZ are widespread in genetic loci for the assembly of unrelated glycostructures in bacteria and yeast. In K. pneumoniae, simultaneous production of both O1 glycoforms is enabled by the lack of specificity of the ABC transporter that exports the nascent glycan, and the data reported here provide mechanistic understanding of the capacity for evolution of antigenic diversity within an important class of biomolecules produced by many bacteria.