Abstract Aims To study the community structure and habitat preferences of the Epsilonematidae and Draconematidae in coral degradation zones. To assess the contribution of different localities and microhabitats to meiobenthic diversity in such ecosystems. To discuss dispersive capacities and the occurrence of cryptic species in meiobenthic organisms. Location Porcupine Seabight (north-east Atlantic Ocean; continental slope) and a transect along the Kenyan coast (Indian Ocean; shallow lagoon). Methods In the north-east Atlantic, dead coral fragments, sponge skeletons and sediment were collected with a boxcorer. Along the Kenyan coast, dead coral fragments and coral gravel were collected during snorkelling and skin diving. Only nematodes belonging to the families Epsilonematidae and Draconematidae were considered. Community structure was analysed using multivariate techniques. Biodiversity was represented via rarefaction curves. Additive partitioning of species diversity was conducted. Turnover between microhabitats within locations and between locations within microhabitats were compared in a ternary plot. Results Twelve epsilonematid and five draconematid species were found in the Porcupine Seabight. In Kenya, 39 epsilonematid and 20 draconematid species were distinguished. Three species were found at both sampling locations. A table with the known distribution of all currently described species encountered in our study area is provided. At both sampling locations, the communities on coral fragments were significantly different from those in the other microhabitats, and were most diverse. In Kenya, species richness was mainly determined by local diversity and by turnover between localities. The contribution of β-diversity decreased when abundance data were analysed. Turnover between microhabitats and between coral samples from different localities was higher than turnover between locations for gravel samples. Main conclusions Coral fragments were recognized as favourable substrata for typically epifaunal nematodes. Species-specific habitat preferences were explained by finely tuned morphological adaptations. Our results suggest that cosmopolitan species could well be cryptic species, and this explanation for the existence of morphologically identical nematodes in geographically distant areas is weighed up against other plausible explanations. Coral degradation zones are an important source for new species of Epsilonematidae and Draconematidae. The addition of sampling locations contributed to the total number of species, although the added species were generally rare.