This species is commonly found in shallow waters on and near coral reefs and occasionally in brackish waters. Juveniles are typically found in extremely shallow water (±15 to 100 cm) inside lagoons, often swimming along the shoreline; adults typically occur on shallow parts of the forereef, often moving over the reef crest and onto the reef flat at flood tide. Individual adults inhabit a relatively small home range of ±2.5 km2 and appear to reside close to their home reef but occasionally cross deepwater channels between adjacent reefs.
There is a variety of biotic reef types, including oyster reefs and sponge reefs, but the most massive and widely distributed are tropical coral reefs. Although corals are major contributors to the framework and bulk material comprising a coral reef; the organisms most responsible for reef growth against the constant assault from ocean waves are calcareous algae, especially, although not entirely, coralline algae.