The simple and cost-efficient preparation of high-performance nitrogen-doped carbon aerogel (N-CA) for supercapacitors and other applications is still a big challenge. In this work, we have presented a facile strategy to synthesize hierarchically porous N-CA, which is based on solvothermal polymerization of phenol and formaldehyde under hypersaline condition with ethylenediamine (EDA) functioning as both a catalyst and a nitrogen precursor. Benefited from the catalytic effect of EDA on the polymerization, the obtained N-CA has a predominant amount of micropores (micropore ratio: 52%) with large specific surface area (1201.1 m2·g−1). In addition, nitrogen doping brings N-CA enhanced wettability and reduced electrochemical impedance. Therefore, the N-CA electrode shows high specific capacitance (426 F·g−1 at 1 A·g−1 in 0.5 M H2SO4) and excellent cycling stability (104% capacitance retention after 10,000 cycles) in three-electrode systems. Besides, a high energy density of 32.42 Wh·kg−1 at 800 W·kg−1 can be achieved by symmetric supercapacitor based on the N-CA electrodes, showing its promising application for energy storage. Furthermore, N-CA also exhibits good capacity and long recyclability in the absorption of organic solvents.