A B S T R A C T N-doped carbon aerogels were synthesized by the polycondensation of resorcinolformaldehyde-melamine mixtures. The prepolymerization of the precursors was determinant for the preparation of meso/macroporous aerogels with varied nitrogen content, regardless the solution pH and M/R molar ratio. The effect was more pronounced at pH 6, as the hydrogels prepared by the one-step route displayed essentially a microporous character, as opposed to the mesoporous network after prepolymerization. The prepolymerized carbon aerogels presented large capacitance values due to the optimum balance between pore structure, improved wettability and low polarization resistance for the highly doped materials. Salt deionization capacity revealed the importance of the macropore structure in the monolithic configuration of the aerogels for a fast electrosorption of ions.