Porous carbon has been used in many fields because of its adjustable porosity and morphology. However, the prevailing synthesis of porous carbon from organic precursors suffers from complicated procedure and the emission of pollutants and greenhouse gas. Herein, an environmentally benign and facile strategy is reported to rapidly synthesize hierarchical porous carbon (HPC) from greenhouse gas (CO 2 ) at low temperatures. CO 2 reacts with sodium hydride (NaH) to produce foam-like HPC, hydrogen, and sodium carbonate at 320 °C in 15 s. No other byproducts or pollutants are produced in the synthesis process. As-synthesized foam-like HPC shows high macro-meso-microporosity, which may facilitate more lithium-ion storage in foam-like HPC. When applied as anode materials for lithium-ions batteries, the foam-like HPC shows a reversible capacity of ∼630 mAh g –1 at 200 mA g –1 after 200 cycles and maintains stable reversible capacity of ∼470 mAh g –1 at 500 mA g –1 even up to 500 cycles. This green and efficient strategy offers us an alternative route to synthesize HPCs for energy storage from greenhouse gas.