Little quantitative ecological information exists on the diets of most invertebrate feeding reptiles, particularly nocturnal or elusive species that are difficult to observe. In the UK and elsewhere, reptiles are legally required to be relocated before land development can proceed, but without knowledge of their dietary requirements, the suitability of receptor sites cannot be known. Here, we tested the ability of non-invasive DNA-based molecular diagnostics (454 pyrosequencing) to analyse reptile diets, with the specific aims of determining which earthworm species are exploited by slow worms (the legless lizard Anguis fragilis) and whether they feed on the deeper-living earthworm species that only come to the surface at night. Slow worm faecal samples from four different habitats were analysed using earthworm-specific PCR primers. We found that 86% of slow worms (N=80) had eaten earthworms. In lowland heath and marshy/acid grassland, Lumbricus rubellus, a surface-dwelling epigeic species, dominated slow worm diet. In two other habitats, riverside pasture and calciferous coarse grassland, diet was dominated by deeper-living anecic and endogeic species. We conclude that all species of earthworm are exploited by these reptiles and lack of specialization allows slow worms to thrive in a wide variety of habitats. Pyrosequencing of prey DNA in faeces showed promise as a practical, rapid and relatively inexpensive means of obtaining detailed and valuable ecological information on the diets of reptiles. © 2011 Blackwell Publishing Ltd.