Carbon capture and sequestration are vital industrial processes that not only mitigate the greenhouse effect but also promote upgrading of low-quality natural gas. Porous adsorbent-based adsorption separation process appeals to be promising, while it still remains a great challenge to develop adsorbents with high adsorption uptake and selectivity of CO2 as well as high working capacity in practical applications. In this work, a group of gallate-based metal-organic frameworks with aperture size of 3.52 to 3.65 Å were reported for molecular sieving of CO2 from N2 and CH4. Remarkably, Mg-gallate exhibited a record-high uptake of CO2 (5.05 mmol g−1) among all reported molecular sieving adsorbents combined with ultrahigh uptake ratio of CO2/CH4 (29.7) and CO2/N2 (84.2) at 1 bar and 298 K. Multiple O-H…C and O…H-O interactions afford dense packing of CO2 molecules in the framework structure with a density up to 1.06 g cm−3 on Mg-gallate, verified by density function theory calculations. Experimental breakthrough experiments confirmed the superb separation performance of flue gas and natural gas over a wide range of temperature. Robust structure and cycling stability along with facile scale-up synthesis method further offer great potential of M−gallate in industrial applications.