A scalable, template-free synthetic strategy is presented for the preparation of ultramicroporous carbon nitride frameworks (CNFs) through a chemical blowing approach by using ammonium chloride as blowing agent and hexamethylene tetraamine as the C and N precursor and a subsequent potassium hydroxide chemical activation is employed to obtain CNFs with surface areas up to 1730 m 2 g −1 along with a high nitrogen content of 13.3 wt%. CNFs showed CO 2 uptake capacities up to 5.74 mmol g −1 at 1 bar and 1.67 mmol g −1 at 0.15 bar, 273 K along with a very high CO 2 /N 2 selectivity. In addition, H 2 uptake capacity of 1.9 wt% and the isosteric heats of adsorption (Q st ) value of 9.0 kJ mol −1 at zero coverage have been also observed. Moreover, the presence of nitrogendoped graphene walls in CNFs also facilitated their application as supercapacitors, with capacitance values up to ≈114 F g −1 at 0.5 A g −1 , along with a good cyclability and capacitance retention. This approach effectively extends unique surface properties of carbon nitrides into the micropore regime for effective capture of small gases and energy storage applications. Importantly, textural properties of CNFs can be simply tuned by judicious choice of organic precursors and the blowing agent.