Preparing carbon materials with both high surface area and density is crucial for improving the volumetric performance of supercapacitors. Herein, we show a novel phenomenon that chitosan can go through spontaneous densification during chemical activation, enabling the microporous carbon with large surface area and extremely high compaction density (2,007 m2 g−1, 1.21 g cm−3). This is quite different from direct pyrolysis and/or activation of many other carbon precursors, which usually form loose structure due to the serious foaming. The mechanism is revealed as the formation of highly crosslinked and stable scaffold by the thermally induced Schiff base reaction between amino and aldehyde groups, which not only inhibits the foaming phenomenon, but also facilitates further aromatization of carbon scaffold. The optimized sample shows high gravimetric and volumetric capacitances (280 F g−1 and 339 F cm−3 at 1 A g−1) and good rate performance (58% retention at 100 A g−1) for aqueous supercapacitors, outperforming most of the reported carbon materials. Considering the low-cost and simple process, this work may provide a new way for structural design and practical application of dense carbon materials.