Identifying galaxy clusters through overdensities of galaxies in photometric surveys is the oldest 1,2 and arguably the most economic and mass-sensitive detection method, 3,4 compared to X-ray [5][6][7] and SunyaevZel'dovich Effect 8 surveys that detect the hot intracluster medium. However, a perrennial problem has been the mapping of optical 'richness' measurements on to total cluster mass. 3,[9][10][11][12] Emitted at a conformal distance of 14 gigaparsecs, the cosmic microwave background acts as a backlight to all intervening mass in the Universe, and therefore has been gravitationally lensed. [13][14][15] Here we present a calibration of cluster optical richness at the 10 per cent level by measuring the average cosmic microwave background lensing convergence measured by Planck towards the positions of large numbers of optically-selected clusters, detecting the deflection of photons by haloes of total mass of the order 10 14 M . Although mainly aimed at the study of larger-scale structures, the Planck lensing reconstruction can yield nearly unbiased results for stacked clusters on arcminute scales. The lensing convergence only depends on the redshift integral of the fractional overdensity of matter, so this approach offers a clean measure of cluster mass over most of cosmic history, largely independent of baryon physics.Experiments such as the Atacama Cosmology Telescope (ACT), 16 South Pole Telescope (SPT) 17 and the Planck 18 satellite have now detected gravitational lensing of the cosmic microwave background (CMB) and produced large-area maps of lensing potential that detect features on 10-arcminute scales, effectively representing the projected mass density of the Universe back to the surface of last scattering. This offers a new method of understanding how visible matter traces the overall matter density field. 19,20 Clusters of galaxies are the rarest peaks in the matter density field and contain the most massive and oldest galaxies at any epoch; for this reason, they are simultaneously powerful cosmological probes 21 and unique environments for studying galaxy evolution. Naturally, clusters are expected to be strong deflectors of CMB photons, and therefore should be detectable, at least statistically, in maps of the CMB lensing field. This was first demonstrated with the 3.1σ detection of the lensing signal of 512 Sunyaev-Zel'dovich Effect (SZE) seleted clusters in SPT data, 22 where the lensing-and SZE-derived cluster masses were found to be in agreement. A 3.2σ statistical lensing signal was also detected in the ACT lensing map for 12,000 optically-selected galaxies, thought to reside on average in group-scale halos M ≈ 10 13 M , 23 demonstrating how the radial profile of the lensing convergence can be used to estimate the projected mass density around the target galaxies. 15,25 We now extend this to more massive systems over 1 /3 of the sky. The convergence of the lensing field caused by a foreground mass can be expressed in the classical lensing framework in terms of the projected mass density aswh...