Shigella flexneri is prevalent worldwide and is the most common Shigella species in many countries. At least 19 S. flexneri serotypes exist, and serotype information is important for epidemiologic and vaccine development purposes. We evaluated the performance of real time PCR (PCR) assays for O-antigen modification genes to identify the major serotypes on isolates and direct stool samples. The assays were formulated into two multiplex panels: one panel included gtrII, gtrV, gtrX, oac, and wzx6 to identify S. flexneri serotype 2a, 2b, 3a, 5a, 5b, 6, and X, the other panel included ipaH, gtrI, gtrIc, gtrIV, to confirm Shigella detection and further identify S. flexneri serotype 1a, 1b, 1d, 3b, 4a, 4b, 7a, and 7b. We first evaluated 283 Shigella isolates and PCR serotyping demonstrated 97.0% (95% confidence interval 93.0% - 99.0%) sensitivity and 99.9% (99.9%-100%) specificity compared to conventional serotyping. The assays were then utilized on direct stool specimens. A quantitative detection algorithm was developed with a validation set of 174 Shigella culture positive stool samples, and further tested with a derivation set of 164 samples. The PCR serotyping on stool achieved 93% (89%-96%) sensitivity and 99% (99%-100%) specificity compared to serotyping. Most discrepancies were genotypic-phenotypic discordance, not genotypic failure. These real-time PCR assays provide an efficient and novel tool for S. flexneri serotype identification.