A thorough and coherent classification of the phylum Nematoda is essential if the evolution of countless phenotypes is to be understood. Here, Mark Dorris, Paul De Ley and Mark Blaxter discuss how the application of molecular phylogenetics is helping to resolve some of the inconsistencies in morphological classification and phylogeny by establishing relationships between free-living and parasitic groups, showing possible patterns underlying the origins of parasitism and placing key nematode species in an evolutionary context for comparative study.