There is an increasing demand for developing environment-friendly and cost-effective strategies to synthesize high-performance flexible supercapacitor electrode materials. Biomass-derived carbon materials are very promising and attractive candidates due to their outstanding advantages. Herein, we prepared a foldable composite electrode based on a chitosan-derived N-self-doped carbon sheet (N-CS) and a microfibrillated cellulose fiber (MCF) framework. The N-CS plays a key role in tailoring the electrochemical behavior of electrode, while the MCF framework offers a porous structure with excellent mechanical foldability. In situ PANI improves the conductivity of the MCF framework and provides abundant active redox sites for energy storage. This foldable composite electrode possesses a high specific areal capacitance of 1688.8 mF cm(-2) (139.6 F g(-1), 84.4 F cm(-3)) at 1 mA cm(-2) and an energy density of 11.75 mW h cm(-3) at a power density of 25 mW cm(-3). Furthermore, benefitting from the mechanical foldability of the MCF framework, the composite can perform well in the folded state. Besides, as a PANI-containing electrode material, its long-term cycling stability is pretty good (more than 84% retention after 5000 cycles). Therefore, this work provides an environment-friendly, cost-effective and high-performance electrode material for foldable electronic devices.