Capsular polysaccharide (CPS) genes and pilus islands encode important virulence factors for group B Streptococcus (GBS) genomes. This study aims to detect phylogenetic inconsistency in CPS genes and pilus islands in GBSs and to explore its relationship with invasiveness. A total of 1016 GBS genomes were downloaded from the NCBI public database. The multi-locus sequence typing (MLST) and Bayesian analysis of Population Structure (BAPS) analyses were both conducted for phylogeny construction. Serotyping and pilus typing were determined in silico using the genomic sequences. The CPS and pilus typing results were generally consistent with MLST and BAPS clustering. GBS isolates of serotype II and of the PI-1 + PI-2b and PI-2a types were more prone to phylogenetic inconsistency than the others. Isolates of serotype Ib and of PI-1 + PI-2a were more likely to appear as colonizing strains, whereas PI-2b was more likely to appear in invasive strains. For serotype V, phylogenetic inconsistency occurred more commonly in colonizing isolates, while for serotype III, the opposite occurred. The present study profiles for the first time the phylogenetic inconsistency of CPS genes and pilus islands in global GBS isolates, which is helpful for infection control and the development of new vaccines for the prevention of GBS occurrence. Electronic supplementary material The online version of this article (10.1007/s10096-020-04067-4) contains supplementary material, which is available to authorized users.