Green hydrogen has the potential to address two critical challenges in a zero-carbon energy system: balancing seasonal variability of solar and wind in the electricity sector, and replacing fossil fuels in hard-to-electrify sectors. In this study, focusing on China, we deploy a provincial-scale energy system planning and operation model to examine the technical and cost-optimal potential of green hydrogen to fully remove carbon-based fuels in the electricity and hard-to-electrify sectors by 2050. Our results show that green hydrogen infrastructure can enable more cost-effective decarbonization of both the electricity and hard-to-electrify sectors. First, in the zero-carbon electricity sector alone, utilizing green hydrogen as long-duration storage enables a 17% reduction in the electricity-only cost (ZE scenario) relative to one without hydrogen. However, cost savings hinge on the availability of underground hydrogen storage. Second, coupling the electricity and hard-to-electrify sectors by sharing green hydrogen infrastructure reduces the combined energy system cost by 6% compared to a decoupled energy system. Third, the coupled energy system also makes green hydrogen comparable to fossil fuel-based gray and blue hydrogen costs in China. Allocating the entire savings realized in the coupled energy system to just the hydrogen used as fuel/feedstock in hard-to-electrify sectors yields a 24% reduction in the hydrogen-only cost relative to the cost under the decoupled system. Last, coupling hydrogen infrastructure between electricity and hard-to-electrify sectors yields a substantially different spatial pattern of hydrogen production. In the decoupled energy system, 80% of hydrogen demand in electricity and hard-to-electrify sectors is produced locally within the same provinces, but the coupled energy system cuts local production to 30%, shifting production to high renewable energy generating provinces. Understanding the spatial patterns of optimal hydrogen infrastructure siting will help plan an integrated electricity and hydrogen system that can cost-effectively decarbonize multiple sectors and China’s broader economy.