A general method based on two-phase polymerization has been described to synthesize mesoporous carbons via self-assembly. Mild reacting conditions and wide composition ranges are the obvious advantages of this method over the techniques previously reported.