The species is found in the Indo-Pacific, including the Red Sea. It is found in tropical and subtropical waters. In the Indian Ocean, they are found in the Red Sea, the Gulf of Aden, eastern Africa, Madagascar, Seychelles, the Persian Gulf, the Arabian Sea, the Maldives, Sri Lanka, the Andaman Sea, Australia, and Indonesia. In the Pacific Ocean, they are found in the Gulf of Thailand, Indonesia, the Philippines, China, Taiwan, Japan, the Great Barrier Reef, New Zealand, New Caledonia, Polynesia, Melanesia, and Hawaii in the Indo-Pacific part of the Pacific Ocean. In the eastern Pacific Ocean, they are found from the Gulf of California south to Peru and the Galapagos Islands. There are some reports of this species in the Mediterranean Sea. They live in coral reefs and lagoons. Individuals of this species are encountered in depths of 1 to 12 metres (3.3 to 39.4 ft).