Peatlands are critical to global biogeochemical cycles because their large accumulations of organic carbon (OC) and nitrogen (N). Broadscale peatland depth maps are needed to assess stocks of OC and N. We used a large peat-core dataset (n=7,111) to assess which environmental variables control peat depth across the extratropical northern hemisphere, testing climatic variables, topography, mineral soil texture and peatland extent. We find that no single environmental variable can accurately predict peat depth. Rather, analyses with multiple regression models show that greater peat depth is linked to a combination of low potential evapotranspiration, warm summers, and limited intra-annual climatic seasonality. At broad scales, the environmental controls of peatland extent are different from controls on peatland depth. This supports the use of methods that treat peatland extent separately from depth when quantifying peat OC stocks. We evaluate different upscaling methods for peat depth mapping and find that random forest machine learning works better than geographically weighted regression or thematic upscaling because the random forest method is more robust with clustered and spatially variable peat depth data. Consistent with earlier studies, we estimate total northern peat stocks of 400±150 Pg OC and 10±7 Pg N. A large part of this peat, containing ca. 50-100 Pg OC, is stored below the 0-3 m depth interval used for global soil OC inventories. Future peatland mapping efforts should target high-resolution maps of individual peatland basins. Such maps will enable more focused studies into the processes that constrain vertical peat accumulation across space and time.