Most of the excess energy stored in the climate system due to anthropogenic greenhouse gas emissions has been taken up by the oceans, leading to thermal expansion and sea-level rise. The oceans thus have an important role in the Earth’s energy imbalance. Observational constraints on future anthropogenic warming critically depend on accurate estimates of past ocean heat content (OHC) change. We present a reconstruction of OHC since 1871, with global coverage of the full ocean depth. Our estimates combine timeseries of observed sea surface temperatures with much longer historical coverage than those in the ocean interior together with a representation (a Green’s function) of time-independent ocean transport processes. For 1955–2017, our estimates are comparable with direct estimates made by infilling the available 3D time-dependent ocean temperature observations. We find that the global ocean absorbed heat during this period at a rate of 0.30 ± 0.06 W/m2 in the upper 2,000 m and 0.028 ± 0.026 W/m2 below 2,000 m, with large decadal fluctuations. The total OHC change since 1871 is estimated at 436 ± 91 ×1021 J, with an increase during 1921–1946 (145 ± 62 ×1021 J) that is as large as during 1990–2015. By comparing with direct estimates, we also infer that, during 1955–2017, up to one-half of the Atlantic Ocean warming and thermosteric sea-level rise at low latitudes to midlatitudes emerged due to heat convergence from changes in ocean transport.