The Indo-Australian Archipelago supports the world's richest coral reef biodiversity hotspot. Traditional hypotheses that account for such exceptional biodiversity have highlighted the importance of environmental variables such as habitat area and energy input. Recently, however, an additional explanation has been proposed based on geometric constraints in the placement of geographical ranges within a bounded domain, which cause a mid-domain peak in species richness; the mid-domain effect (MDE). Here, for the first time, we examine the relative importance of area, energy and MDE jointly on species richness patterns. Model selection indicates that the best model incorporates MDE and reef area, but no energy effect; moreover, this best-fit model captures all major features of reef fish and coral species richness patterns. Habitat area is the major environmental factor influencing species richness. The prevention of further fragmentation and loss of habitat area is of critical importance for the conservation of coral reef biodiversity.