context: Nowadays, carbon nanomaterials are considered as the most important supercapacitor electrode materials. But it's still a great challenge to design rational structures of carbon materials at both nano and micro scales to endow carbon electrode materials with outstanding electrochemical performance. Herein, a well-designed compressible and elastic N-doped porous carbon nanofiber aerogel (N-PCNFA) with hierarchical cellular structures in both the PAN/ZIF-8-based carbon nanofibers and the 3D carbon monolith was prepared by a simple method. A large specific surface area was obtained for the construction of abundant pore structures and a robust architecture was built by the introduction of mechanically reinforced structures, which would endow the N-PCNFA electrode material with a vast surface area for ion adsorption/desorption, plenty of short channels for electrolyte diffusion and stable frameworks during the charge/discharge process. N heteroatoms were also incorporated into the carbon material as active sites for faradaic redox reactions. Thus, the N-PCNFA electrodes exhibited superior electrochemical performance, with a high specific capacitance of 279 F g−1 at 0.5 A g−1, consisting of pseudocapacitance (∼46%) and electrochemical double-layer capacitance (∼54%), remarkable rate performance of 59% at 20 A g−1 and excellent long-term durability. Moreover, the simple and general strategy for construction of compressible and elastic porous carbon nanofiber aerogels with delicate microstructures is also applicable to other advanced functional materials for a wide range of applications.