Accurate and precise temperatures of metamorphism and magmatism can be obtained from O-isotope compositions of minerals using a system of linear equations that defines fractionation and mass balance of O isotopes among all minerals in a rock. This approach—linear-equation thermometry (LinT)—does not require that cooling rates or absolute O-diffusion parameters be known. If O diffusivities are known, closure temperatures for each phase can be calculated and inverted to determine a temperature-dependent cooling rate that is accurate to a factor of three. The highest and most precise temperatures will be preserved in rocks containing quartz and garnet, because O diffuses slowly in garnet and garnet-quartz O-isotope fractionation is relatively large. The technique will be most useful in rocks with low-variance mineral assemblages in which precise pseudosection analysis is inhibited by wide spacing of reactions in pressure-temperature space. Application of LinT to ultrahigh-temperature gneisses from Madagascar yields temperatures of 927 ± 31 °C, consistent with independent thermometry.