The PANI and PANI/g-C3N4 electrodes showed a retention of 75.15%, and 81.91%, respectively of their initial capacitance after 1000 cycles. The synergistic effect of g-C3N4 and PANI has significantly reduced the stacking of g-C3N4, by the introduction of PANI nanorod spacers to facilitate the complete infiltration of the electrolyte, and the porous structure of the composite materials for providing a rapid charge-transfer reaction.