Ordered mesoporous carbons (OMCs) with controllable pore sizes in the range of 4–10nm are prepared by a template procedure using 2D hexagonal MSU-H and 3D cubic KIT-6 as hard templates and boric acid as the pore expanding agent. The electrochemical performances of the as-synthesized OMCs as electrode materials for electrochemical double layer capacitors (EDLCs) are characterized by cyclic voltammetry (CV), galvanostatic charge/discharge (GC) and electrochemical impedance spectroscopy (EIS) experiments in 30wt% KOH electrolyte. The influence of the pore size distributions of OMCs on the electrochemical capacitive performances is discussed. The prepared OMCs exhibit good capacitive behaviors with the specific capacitance values ranging from 143 to 205.3Fg−1 at a voltage scan rate of 5mVs−1 and 81 to 86% retained at a high scan rate of 100mVs−1. OMC-M-2 shows the highest specific surface capacitance value of 27.5μFcm−2 at 5mVs−1 with a peak pore size of 7.8nm and a Brunauer–Emmet–Teller (BET) surface area of 729.3m2g−1. The analysis of two kinds of pore symmetries of OMCs with the same pore size of about 6.5nm shows that the 3D cubic OMC exhibited superior capacitive performance than the 2D hexagonal OMC.