Humans are continuing to add vast amounts of carbon dioxide (CO2) to the atmosphere through fossil fuel burning and other activities. A large fraction of the CO2 is taken up by the oceans in a process that lowers ocean pH and carbonate mineral saturation state. This effect has potentially serious consequences for marine life, which are, however, difficult to predict. One approach to address the issue is to study the geologic record, which may provide clues about what the future holds for ocean chemistry and marine organisms. This article reviews basic controls on ocean carbonate chemistry on different timescales and examines past ocean chemistry changes and ocean acidification events during various geologic eras. The results allow evaluation of the current anthropogenic perturbation in the context of Earth's history. It appears that the ocean acidification event that humans are expected to cause is unprecedented in the geologic past, for which sufficiently well-preserved records are available.