Recent studies have demonstrated that the Echinococcus granulosus antigen B (AgB) interferes with the intermediate hosts' immune response and is encoded by a multigene family. The number of members within the family is still uncertain, but there are several evidences of a large genetic variability. The E. granulosus AgB genomic sequences available in nucleotide databases can be grouped into four clades, corresponding to genes EgAgB1, EgAgB2, EgAgB3 and EgAgB4. In the present study, we use PCR amplifications followed by cloning and sequencing to evaluate the genetic variability for AgB isoforms. Two pairs of primers were independently used for PCR amplification. Both PCR reactions from each of three isolated protoscolex (larvae) were cloned in a plasmid vector and the plasmid inserts of 30 colonies from each cloning experiment were sequenced. Using phylogenetic tools, the 113 EgAgB clones are classified as follows: 25 are related to EgAgB1, 24 to EgAgB2, 9 to EgAgB3 and 39 to EgAgB4. The remaining 16 clones form a separate cluster, which we name EgAgB5, more closely related to EgAgB3 than to any of the other genes. Within each gene group, a number of variant sequences occur, which differ from one another by one or few nucleotides. One EgAgB3 clone has a premature stop codon (pseudogene) and an EgAgB2 clone lacks the region corresponding to the intron. The overall variation cannot be explained by differences among the asexual protoscoleces, or by experimental artifacts. Using Echinococcuss AgB genes from other species/strains as outgroups, neutrality is rejected for EgAgB2, and balancing selection is detected for EgAgB5, which also seems to be involved in gene conversion. We suggest that EgAgB1-EgAgB5 represent a family of contingency genes, that is, genes that are variably expressed, so that some but not others are expressed in each individual parasite. Contingency genes are common in parasitic protozoa and other microparasites, but the EgAgB family is the first set identified in a multicellular parasite.