Nano- and mesoporous boron carbon nitrides with very high surface areas up to 1560 m2 g−1 are obtained by pyrolysis of a graphitic carbon nitride mpg-C3N4 infiltrated with a borane complex. This reactive hard-templating approach provides easy composition and texture tuning by temperature adjustment between 800 and 1400 °C. The process yields BxCyNzOvHw materials as direct copies of the initial template with controlled compositions of 0.15 ≤ x ≤ 0.36, 0.10 ≤ y ≤ 0.12, 0.14 ≤ z ≤ 0.32, and 0.11 ≤ v ≤ 0.28. The nano and mesoporosities can also be tuned in order to provide hierarchical materials with specific surface areas ranging from 610 to 1560 m2 g−1. Such high values, coupled with resistance against air oxidation up to 700 °C, suggest potential materials for gas storage and as catalyst supports. Indeed, it is demonstrated that these compounds exhibit high and tunable H2 uptakes from 0.55 to 1.07 wt.% at 77 K and 1 bar, thus guiding further search of materials for hydrogen storage.