Lipopolysaccharide on the surface of Escherichia coli constitutes the O antigens which are important virulence factors that are targets of both the innate and adaptive immune systems and play a major role in host–pathogen interactions. O antigens are responsible for antigenic specificity of the strain and determine the O serogroup. The designation of O serogroups is important for classifying E. coli strains, for epidemiological studies, in tracing the source of outbreaks of gastrointestinal or other illness, and for linking the source to the infection. For conventional serogroup identification, serotyping by agglutination reactions against antisera developed for each of the O serogroups has been used. In the last decade, many O-antigen gene clusters that encode for the enzymes responsible for the synthesis of the variable oligosaccharide region on the surface of the bacteria have been sequenced and characterized. Unique gene sequences within the O-antigen gene clusters have been targeted for identification and detection of many O groups using the polymerase chain reaction and microarrays. This review summarizes current knowledge on the DNA sequences of the O-antigen gene clusters, genetic-based methods for O-group determination and detection of pathogenic E. coli based on O-antigen and virulence gene detection, and provides perspectives on future developments in the field.