Helicobacter pylori persistently colonizes the gastric mucosa of half the human population. It is one of the most genetically diverse bacterial organisms and subvariants are continuously emerging within an H. pylori population. In this study we characterized a number of single-colony isolates from H. pylori communities in various environmental settings, namely persistent human gastric infection, in vitro bacterial subcultures on agar medium, and experimental in vivo infection in mice. The lipopolysaccharide (LPS) O-antigen chain revealed considerable phenotypic diversity between individual cells in the studied bacterial communities, as demonstrated by size variable O-antigen chains and different levels of Lewis glycosylation. Absence of high-molecular-weight O-antigen chains was notable in a number of experimentally passaged isolates in vitro and in vivo. This phenotype was not evident in bacteria obtained from a human gastric biopsy, where all cells expressed high-molecular-weight O-antigen chains, which thus may be the preferred phenotype for H. pylori colonizing human gastric mucosa. Genotypic variability was monitored in the two genes encoding alpha1,3-fucosyltransferases, futA and futB, that are involved in Lewis antigen expression. Genetic modifications that could be attributable to recombination events within and between the two genes were commonly detected and created a diversity, which together with phase variation, contributed to divergent LPS expression. Our data suggest that the surrounding environment imposes a selective pressure on H. pylori to express certain LPS phenotypes. Thus, the milieu in a host will select for bacterial variants with particular characteristics that facilitate adaptation and survival in the gastric mucosa of that individual, and will shape the bacterial community structure.