Nematodes are remarkably successful, both as free-living organisms and as parasites. The diversity of parasitic lifestyles displayed by nematodes, and the diversity of hosts used, reflects both a propensity towards parasitism in the phylum, and an adaptability to new and challenging environments. Parasitism of plants and animals has evolved many times independently within the Nematoda. Analysis of these origins of parasitism using a molecular phylogeny highlights the diversity underlying the parasitic mode of life. Many vertebrate parasites have arthropod-associated sister taxa, and most invade their hosts as third stage larvae: these features co-occur across the tree and thus suggest that this may have been a shared route to parasitism. Analysis of nematode genes and genomes has been greatly facilitated by the Caenorhabditis elegans project. However, the availability of the whole genome sequence from this free-living rhabditid does not simply permit definition of ‘parasitism’ genes; each nematode genome is a mosaic of conserved features and evolutionary novelties. The rapid progress of parasitic nematode genome projects focussing on species from across the diversity of the phylum has defined sets of genes that have patterns of evolution that suggest their involvement with various facets of parasitism, in particular the problems of acquisition of nutrients in new hosts and the evasion of host immune defences. With the advent of functional genomics techniques in parasites, and in particular the possibility of gene knockout using RNA interference, the roles of many putative parasitism genes can now be tested.