Two-dimensional ordered mesoporous carbon nitride (OMCN) has been successfully prepared for the first time using SBA-15 mesoporous silica and melamine as template and precursor respectively, by a nano hard-templating approach. A series of OMCN-x samples with different pyrolysis temperatures have been reported. The formation of these composite materials was verified by detailed characterization (e.g., Fourier transform infrared spectroscopy, X-ray photoelectron spectroscopy, N2 adsorption, X-ray diffraction, scanning electron microscopy, and transmission electron microscopy). The results showed that the materials were structurally well ordered with two-dimensional porous structure, high surface area and large pore volume. The influence of BET surface area and different amounts of N-bonding configurations formed at different pyrolysis temperatures of OMCN-x for the electrocatalysis towards hydrogen peroxide, nitrobenzene, and nicotinamide adenine dinucleotide were investigated in detail. Results indicated that OMCN treated at 800°C with largest BET surface area and highest amounts of pyrindinic N showed improved electrocatalytic activity for H2O2, nitrobenzene, and NADH in neutral solution., (© 2013 Published by Elsevier B.V.)