Diarrheagenic Escherichia coli serotypes are associated with various clinical syndromes, yet the precise correlation between serotype and pathotype remains unclear. A major barrier to such studies is the reliance on antisera-based serotyping, which is culture-dependent, low-throughput, and cost-ineffective. We have established a highly multiplex PCR-based serotyping assay, termed the MeltArray E. coli serotyping (EST) assay, capable of identifying 163 O-antigen-encoding genes and 53 H-antigen-encoding genes of E. coli. The assay successfully identified serotypes directly from both simulated and real fecal samples, as demonstrated through spike-in validation experiments and a retrospective study. In a multi-province study involving 637 E. coli strains, it revealed that the five major diarrheagenic pathotypes have distinct serotype compositions. Notably, it differentiated 257 Shigella isolates into four major Shigella species, distinguishing them from enteroinvasive E. coli based on their distinct serotype profiles. The assay's universality was further corroborated by in silico analysis of whole-genome sequences from the EnteroBase. We conclude that the MeltArray EST assay represents a paradigm-shifting tool for molecular serotyping of E. coli, with potential routine applications for comprehensive serotype analysis, disease diagnosis, and outbreak detection.