Herein, the preparation of a nanocomposite based on a defective mesoporous carbon (DMC) and polyaniline (PANI) as an efficient electrode material for the supercapacitor application is reported. DMC, with the interconnected porous network, was synthesized through a facile process using sucrose, commercial nanoparticles of SiO2 and KNO3 as carbon precursor, hard template and defect generating agent respectively. DMC/PANI nanocomposite was produced via an in-situ polymerization of aniline in the presence of DMC. The preparation of PANI in the porous matrix of DMC was proved using different structural analyses including FT-IR, Nitrogen adsorption/desorption, SEM and TEM. The supercapacitive performance of the obtained nanocomposite (DMC/PANI) was evaluated by cyclic voltammetry (CV), electrochemical impedance spectroscopy (EIS) and galvanostatic charge/discharge (GCD) techniques applying 1 M H2SO4 as electrolyte. Compared to DMC and pure PANI, the DMC/PANI delivered the highest specific capacitance reaching to 985 F g(-1) at the applied current density of 0.5 A g(-1). Even at high charge/discharge rate of 10 A g(-1), the excellent specific capacitance of 780 F g(-1) was achieved. Moreover, DMC/PANI composite exhibited long term cyclability, in where 82% of specific capacitance was retained after 5000 GCD measurement at high current density of 5 A g(-1). Further, a symmetric supercapacitor device based on DMC/PANI was successfully assembled and specific energy of 32 Wh kg(-1) at specific power of 125 W kg(-1) was obtained. The presented results are higher or comparable to the earlier reported works based on carbon/PANI composite.