The O-antigen is an important component of the outer membrane of Gram-negative bacteria. It is a repeat unit polysaccharide and consists of a number of repeats of an oligosaccharide, the O-unit, which generally has between two and six sugar residues. O-Antigens are extremely variable, the variation lying in the nature, order and linkage of the different sugars within the polysaccharide. The genes involved in O-antigen biosynthesis are generally found on the chromosome as an O-antigen gene cluster, and the structural variation of O-antigens is mirrored by genetic variation seen in these clusters. The genes within the cluster fall into three major groups. The first group is involved in nucleotide sugar biosynthesis. These genes are often found together in the cluster and have a high level of identity. The genes coding for a significant number of nucleotide sugar biosynthesis pathways have been identified and these pathways seem to be conserved in different O-antigen clusters and across a wide range of species. The second group, the glycosyl transferases, is involved in sugar transfer. They are often dispersed throughout the cluster and have low levels of similarity. The third group is the O-antigen processing genes. This review is a summary of the current knowledge on these three groups of genes that comprise the O-antigen gene clusters, focusing on the most extensively studied E. coli and S. enterica gene clusters.