Bacteria have been shown to generate constant genetic variation in a process termed phase variation. We present a tool based on whole genome sequencing that allows detection and quantification of coexisting genotypes mediated by genomic inversions in bacterial cultures. We tested our method on widely used strains of Escherichia coli, and detected stable and reproducible phase variation in several invertible loci. These are shown here to be responsible for maintaining constant variation in populations grown from a single colony. Applying this tool on other bacterial strains can shed light on how pathogens adjust to hostile environments by diversifying their genomes.