The ability to form selective cell-cell adhesions is an essential property of metazoan cells. Members of the cadherin superfamily are important regulators of this process in both vertebrates and invertebrates. With the advent of genome sequencing projects, determination of the full repertoire of cadherins available to an organism is possible and here we present the identification and analysis of the cadherin repertoires in the genomes of Caenorhabditis elegans and Drosophila melanogaster. Hidden Markov models of cadherin domains were matched to the protein sequences obtained from the translation of the predicted gene sequences. Matches were made to 21 C. elegans and 18 D. melanogaster sequences. Experimental and theoretical work on C. elegans sequences, and data from ESTs, show that three pairs of genes, and two triplets, should be merged to form five single genes. It also produced sequence changes at one or both of the 5' and 3' termini of half the sequences. In D. melanogaster it is probable that two of the cadherin genes should also be merged together and that three cadherin genes should be merged with other neighbouring genes. Of the 15 cadherin proteins found in C. elegans, 13 have the features of cell surface proteins, signal sequences and transmembrane helices; the other two have only signal sequences. Of the 17 in D. melanogaster, 11 at present have both features and another five have transmembrane helices. The evidence currently available suggests about one-third of the cadherins in the two organisms can be grouped into subfamilies in which all, or parts of, the molecules are conserved. Each organism also has a approximately 980 residue protein (CDH-11 and CG11059) with two cadherin domains and whose sequences match well over their entire length two proteins from human brain. Two proteins in C. elegans, HMR-1A and HMR-1B, and three in D. melanogaster, CadN, Shg and CG7527, have cytoplasmic domains homologous to those of the classical cadherin genes of chordates but their extracellular regions have different domain structures. Other common subclasses include the seven-helix membrane cadherins, Fat-like protocadherins and the Ret-like cadherins. At present, the remaining cadherins have no obvious similarities in their extracellular domain architecture or homologies to their cytoplasmic domains and may, therefore, represent species-specific or phylum-specific molecules.