Herein, by using isoreticular zeolitic imidazolate frameworks (IRZIFs) as a template, we report the synthesis, morphology, and gas adsorption properties of porous carbon synthesized by a nanocasting method at 1000 °C, in which furfuryl alcohol (FA) was used as a carbon source. By using IRZIFs with variable porosity as templates, we could achieve control over the carbon porosity and H2 and CO2 uptake. The resultant microporous carbon C-70, synthesized by using ZIF-70 as the template, is the most porous (Brunauer–Emmett–Teller (BET) surface area 1510 m2 g−1). Carbon C-68, synthesized by using ZIF-68, has moderate porosity (BET surface area 1311 m2 g−1), and C-69, synthesized by using ZIF-69, has the lowest porosity in this series (BET surface area 1171 m2 g−1). The porous carbons C-70, C-68, and C-69, which have graphitic texture, have promising H2 uptake capacities of 2.37, 2.15, and 1.96 wt %, respectively, at 77 K and 1 atm. Additionally, C-70, C-68, and C-69 show CO2 uptake capacities of 5.45, 4.98, and 4.54 mmol g−1, respectively, at 273 K and 1 atm. The gas uptake trends shown by C-70, C-68, and C-69 clearly indicate the dependence of carbon porosity on the host template. Moreover, the as-synthesized carbons C-70, C-68, and C-69 show variable conductivity.