Coastal wetlands (mangrove, tidal marsh and seagrass) sustain the highest rates of carbon sequestration per unit area of all natural systems primarily because of their comparatively high productivity and preservation of organic carbon within sedimentary substrates. Climate change and associated relative sea-level rise (RSLR) have been proposed to increase the rate of organic-carbon burial in coastal wetlands in the first half of the twenty-first century4, but these carbon–climate feedback effects have been modelled to diminish over time as wetlands are increasingly submerged and carbon stores become compromised by erosion. Here we show that tidal marshes on coastlines that experienced rapid RSLR over the past few millennia (in the late Holocene, from about 4,200 years ago to the present) have on average 1.7 to 3.7 times higher soil carbon concentrations within 20 centimetres of the surface than those subject to a long period of sea-level stability. This disparity increases with depth, with soil carbon concentrations reduced by a factor of 4.9 to 9.1 at depths of 50 to 100 centimetres. We analyse the response of a wetland exposed to recent rapid RSLR following subsidence associated with pillar collapse in an underlying mine and demonstrate that the gain in carbon accumulation and elevation is proportional to the accommodation space (that is, the space available for mineral and organic material accumulation) created by RSLR. Our results suggest that coastal wetlands characteristic of tectonically stable coastlines have lower carbon storage owing to a lack of accommodation space and that carbon sequestration increases according to the vertical and lateral accommodation space created by RSLR. Such wetlands will provide long-term mitigating feedback effects that are relevant to global climate–carbon modelling.