Two kinds of ordered mesoporous carbon (OMC), hexagonal mesoporous carbon CMK-3 and cubic mesoporous carbon CMK-8, are prepared by a hard template nanocasting method. Afterwards, nitric acid modification is conducted to explore the influence of surface functional groups on the supercapacitive characteristics of the OMC electrodes. The electrochemical performances of CMK-3, CMK-8, acid-modified CMK-3 (H-CMK-3) and acid-modified CMK-8 (H-CMK-8) electrodes are investigated in three-electrode cells using alkaline (2M KOH), acidic (2M H2SO4) and neutral (2M Na2SO4) aqueous media. After nitric acid modification, the capacitive performances of two OMCs are improved in KOH, decreased in H2SO4, but showed no change in Na2SO4. The correlations among the change of surface functional groups after acid modification, electrolyte category and the capacitive performance of the OMCs are studied in detail. It can provide a guideline for proper usage of OMC-based materials for the next generation of supercapacitors.