Past models have suggested host–parasite coextinction could lead to linear, or concave down relationships between free-living species richness and parasite richness. I explored several models for the relationship between parasite richness and biodiversity loss. Life cycle complexity, low generality of parasites and sensitivity of hosts reduced the robustness of parasite species to the loss of free-living species diversity. Food-web complexity and the ordering of extinctions altered these relationships in unpredictable ways. Each disassembly of a food web resulted in a unique relationship between parasite richness and the richness of free-living species, because the extinction trajectory of parasites was sensitive to the order of extinctions of free-living species. However, the average of many disassemblies tended to approximate an analytical model. Parasites of specialist hosts and hosts higher on food chains were more likely to go extinct in food-web models. Furthermore, correlated extinctions between hosts and parasites (e.g. if parasites share a host with a specialist predator) led to steeper declines in parasite richness with biodiversity loss. In empirical food webs with random removals of free-living species, the relationship between free-living species richness and parasite richness was, on average, quasi-linear, suggesting biodiversity loss reduces parasite diversity more than previously thought.