N-doped ordered mesoporous carbon (N-OMC) has been one of the most promising choices as the electrode for supercapacitors due to its large surface area and uniform mesoporous structure. However, there is still a big challenge to prepare N-OMC using a relatively simple method. Here, a straightforward preparation of N-OMC was reported in which the precursor zeoliticimidazolate framework was in situ grown in the SBA-15 template by a fast, solvent-free, and atom economic solid–solid grinding strategy. After pyrolysis and removing of the template, the N-OMC was obtained with ordered mesoporous structure, rich oxygen and nitrogen, and a large specific surface area of 1004 m2/g. As the electrode material for supercapacitors, N-OMC displayed an excellent specific capacitance of 228 F/g at 0.2 A/g and superb charge/discharge cycling stability, which is promising for high-performance energy storage. This solid–solid grinding strategy may offer a low-cost and scalable method to produce high-performance N-OMC for the electrode from the zeoliticimidazolate framework.