Heteroatom-doped porous carbon material fabricated from bio-resources has greatly attracted extensive interest in the energy storage field. In this work, we report the cheese-like porous carbon material enriching more heteroatoms such as oxygen and nitrogen fabricated from silkworm pupa in a facile carbonization and activation way. Benefited from the compromise between activator ratio and activation temperature in the activation process, the optimized sample of NBC600-1:3 presents not only a substantial surface of 2005.04 m2 g−1 but also a high heteroatom doped level of 11.90 %, leading to the achievement of the maximal mass specific capacitance of 406 F g−1 at 1 A g−1 and good rate capability up to 70.44 % (286 F g−1) at 20 A g−1 in 6 M KOH solutions. The symmetric electrochemical capacitor assembled displays a high energy density of 21.78 W h kg−1 (at 450 W kg−1) and a power density of 4500 W kg−1 (at 13.75 W h kg−1) in 1 M Na2SO4 solutions. Noticeably, the as-prepared quasi-solid device also presents a perspective performance in various bending angles, indicating a good flexible performance. This work provides the possibility for the application prospects of biomass carbon in flexible electronic.