Serotyping, subtyping and genotyping are important tools for epidemiological studies of group B streptococci (GBS). We investigated the genotype distribution of 353 GBS isolates originating from vaginal or rectal carriage to identify capsular serotypes and subtypes based on the surface protein genes of the alpha-like protein (Alp) family. GBS were recovered from 30% of 1176 pregnant women during the period 2007–2009, with a predominance of capsular genotypes III (35%), Ia (20%), V (17%), II (15%), Ib (8%) and IV (5%). The most common Alp gene was epsilon (26%), followed by rib (22%), alp2 (21%), bca (17%) and alp3 (14%). Several protein genes were significantly associated (G2=249·635, P<0·0001) with particular serotypes: epsilon with Ia, Ib, IV; bca with Ib, II; rib with II, III; alp3 with V; alp2 with III. High genetic diversity within GBS strains was observed using DNA macrorestriction. Serotypes Ib, II and III demonstrated the greatest genetic heterogeneity and serotype V the lowest heterogeneity (relative frequency coefficient ⩾0·03 vs. −0·46, respectively). Macrolide-resistant strains with serotype V and alp3 gene, showed higher uniformity in genetic profile. The distribution of serotypes and surface proteins of GBS strains are necessary data to inform the design and formulation of new GBS vaccines for use in Poland and other countries.