Escherichia coli strains belonging to serogroups O1 and O2 are frequently associated with human infections, especially extra-intestinal infections such as bloodstream infections or urinary tract infections. These strains can be associated with a large array of flagellar antigens. Because of their frequency and clinical importance, a reliable detection of E. coli O1 and O2 strains and also the frequently associated K1 capsule is important for diagnosis and source attribution of E. coli infections in humans and animals. By sequencing the O-antigen clusters of various O1 and O2 strains we showed that the serogroups O1 and O2 are encoded by different sets of O-antigen encoding genes and identified potentially new O-groups. We developed qPCR- assays to detect the various O1 and O2 variants and the K1-encoding gene. These qPCR assays proved to be 100% sensitive and 100% specific and could be valuable tools for the investigations of zoonotic and food-borne infection of humans with O1 and O2 extra-intestinal (ExPEC) or Shiga toxin-producing E. coli (STEC) strains.