The Indo-Pacific marine biodiversity hotspot originated between the late Eocene and the early Miocene. Its origin coincides with an increase in availability of shallow-marine habitats driven by the opening of the South China Sea and the collision of Australia with the Pacific arcs and the southeast Asian margin. However, little is known about the distribution and diversity of past Indo-Pacific marine habitats. Understanding habitat diversity is key for understanding the significance of biodiversity origins and a necessary prerequisite for interpreting biodiversity patterns through time. Here we describe and interpret past carbonate platform environments in Sarawak, Malaysia during a time of active tectonism. We examine upper Eocene to lower Miocene marine shallow-water carbonate deposits from six localities in two limestone formations: the large ramplike Melinau carbonate platform (middle Eocene to early Miocene) and the unattached Subis carbonate platform (early Miocene). Deposits examined in this study represent paleoenvironments. Our analysis reveals an increase in habitat diversity from the Eocene to the Miocene. Mesophotic to oligophotic low-energy environments are typical for the Eocene sites. The corals first appear in the Oligocene deposits, but genuine reef depositional settings are not observed until the Miocene. This study provides both insight into the evolution of the carbonate platform environments along the Sarawak margin, and context for the origin of the Indo-Pacific marine biodiversity hotspot.