Three microhabitat types (dead coral fragments, coral gravel and coral sand) were distinguished and sampled at two locations (Matemwe and Makunduchi) in a tropical lagoon (Zanzibar Island, Tanzania), and the community structure, habitat preferences and biodiversity of the associated harpacticoid copepod fauna was investigated. The harpacticoid fauna is affected by sediment granulometry and by the structural differences between coral and both gravel and sediment. The coral fragments contained a specific assemblage composed of typical ‘phytal’ taxa (Tisbe, Paradactylopodia and Dactylopusia) along with other eurytopic and sediment-dwelling forms (Ameira, Ectinosoma and Amphiascus), which may be attracted by the sediment retained between the coral branches. The assemblages of coral gravel and upper sediment layer did not differ significantly from each other and had mostly the same dominant genera. The sediment from Matemwe was dominated by the interstitial Paramesochridae and the sediment from Makunduchi by Tetragonicipitidae. The coral fragments from Makunduchi sustained a more diverse assemblage than gravel and the different sediment layers. It was assumed that coral form and complexity, with implications for habitable space, nutritional resources and level of predation, are important in structuring diversity of the associated assemblage.