Coastal vegetated habitats, including mangroves, saltmarshes and seagrasses, mitigate climate change by storing atmospheric carbon. Previous blue carbon research has mainly focused on organic carbon stocks. However, recent studies suggest that lateral inorganic carbon export might be equally important. Lateral export is a long-term carbon sink if carbon is exported as alkalinity (TAlk) produced via sulfate reduction coupled to pyrite formation. This dataset evaluates drivers of pyrite formation in coastal vegetated habitats and estimates global pyrite stocks in mangroves. We quantified pyrite stocks in mangroves, saltmarshes and seagrasses along a latitudinal gradient on the Australian East Coast, including a mangrove dieback area, and in the Everglades (Florida, USA). Our results indicate that pyrite stocks were driven by a combination of biomass, tidal amplitude, sediment organic carbon, sedimentation rates, rainfall latitude, temperature, and iron availability. Pyrite stocks were three-times higher in mangroves (103 ± 61 Mg/ha) than in saltmarshes (30 ± 30 Mg/ha) and seagrasses (32 ± 1 Mg/ha).