The dynamic interactions between a host and its intestinal microflora that lead to commensalism are unclear. Bacteria that colonize the intestinal tract do so despite the development of a specific immune response by the host. The mechanisms used by commensal organisms to circumvent this immune response have yet to be established. Here we demonstrate that the human colonic microorganism, Bacteroides fragilis, is able to modulate its surface antigenicity by producing at least eight distinct capsular polysaccharides-a number greater than any previously reported for a bacterium-and is able to regulate their expression in an on-off manner by the reversible inversion of DNA segments containing the promoters for their expression. This means of generating surface diversity allows the organism to exhibit a wide array of distinct surface polysaccharide combinations, and may have broad implications for how the predominant human colonic microorganisms, the Bacteroides species, maintain an ecological niche in the intestinal tract.