This study examines the effects of nitrogen and boron doping on the electrochemical performance of tannin-derived carbon materials synthesized by hydrothermal carbonization (HTC) using ammonia and boric acid, followed by CO 2 activation, focusing on electrochemical capacitor (EC) improvement. HTC treatment of tannins in ammonia and boric acid solutions effectively incorporates N and B into the carbon matrix, inducing changes in chemical, textural and morphological properties. Remarkably, all CO 2 -activated carbon materials exhibit similar specific surface area, estimated using 2D-NLDFT-HS applied to N 2 and H 2 isotherms at -196 °C, allowing a fair comparison of electrochemical behavior based on surface chemistry. Nitrogen doping improved capacitance retention and energy density, surpassing both undoped and B-doped materials despite their comparable surface areas. X-ray photoelectron spectroscopy (XPS) analysis revealed that nitrogen functionalities and quinone groups play a critical role in enhancing charge storage, coupled with boosted Faradaic interactions between them and 1 M H 2 SO 4 , the aqueous electrolyte used in this study. Conversely, materials abundant in carboxylic acid species may hinder electric double-layer formation, thereby limiting electrical storage when used as EC electrodes. N-doped, tannin-derived carbon materials displayed acceptable capacitor performance, achieving specific cell capacitance values close to 42 F•g -1 at 0.5 A•g -1 , with excellent capacitance retention reaching 74% at a high applied current of 40 A•g -1 . This performance, achieved with a surface area close to 1200 m 2 •g -1 , underscores the efficacy of nitrogen doping in enhancing EC performance of tannin-derived carbon materials as promising and sustainable electrode materials.