Pneumococcal parapneumonic empyema is an increasingly common complication in children. Conventional microbiological cultures indicate bacterial causes in as few as 8% of cases; therefore, there is a vital need for new molecular methods of detection and diagnosis. The development and clinical evaluation of real-time PCR-based assays to detect the pneumococcal capsular wzg gene of all serotypes tested are reported here, and 24 of them have been identified in clinical specimens. Using real-time PCR assays with highly specific TaqMan MGB probes that target DNA sequences within the capsular polysaccharide gene cluster, it was possible to differentiate serotypes 1, 3, 5, 4, 6A, 6B, 7F/A, 8, 9V/A/N/L, 14, 15B/C, 18C/B, 19A, 19F/B/C, 23F and 23A. These assays showed high sensitivity (five to ten pneumococcal DNA equivalents) and they were validated with 175 clinical isolates of known serotypes. The clinical value of this approach was demonstrated by analysis of 88 culture-negative pleural fluids from children diagnosed with parapneumonic empyema in three Spanish hospitals. Pneumococcal DNA was detected in 87.5% of pleural fluids, and serotypes 1, 7F and 3 were responsible for 34.3%, 16.4% and 11.9%, respectively, of cases of parapneumonic empyema in children. Such molecular methods are critical for the diagnosis of invasive pneumococcal disease and continued epidemiological surveillance in order to monitor serotype vaccine effectiveness.