Nitrogen-containing activated carbons were prepared from chitosan, a widely available and inexpensive biopolysaccharide, by a simple procedure and tested as electrode material in supercapacitors. The physical activation of chitosan chars with CO 2 led to carbons with a very high nitrogen content (up to 5.4 wt%) and moderate surface areas (1000-1100 m 2 g -1 ). Only chitosan-based activated carbons with a similar microporous structure were considered in this study to evaluate the effect of the nitrogen content and distribution on their electrochemical performance. The N-containing activated carbons were tested in two-and three-electrode supercapacitors using an aqueous electrolyte (1 M H 2 SO 4 ), and they exhibited superior surface capacitance (19.5 lF cm -2 ) and pseudocapacitance compared to a commercial activated carbon with a negligible nitrogen content and similar microporosity. The low oxygen content and the presence of stable quaternary nitrogen improved the charge propagation on the chitosan-based carbons, which was confirmed by the high capacity retention of 83 %. The chitosan-based carbons exhibited excellent cyclic stability and maintained 100 % of their capacitance after 5000 charge/discharge cycles at a current density of 1 A g -1 . These results demonstrate the suitability of chitosan-based carbons for application in energy storage systems.Electronic supplementary material The online version of this article