A green electrochemical approach is developed for the fabrication of polyaniline (PANI) nanofiber and carbon quantum dots (C-dots) nanoparticles. In this regard, C-dots were manufactured by DC power supply by 2 Pt plates in ethanol and NaOH solution. While, PANI was synthesized by chronopotentiometry using a 3-electrode compartment system in aniline and SDS solution. The C-dots/PANI composite was prepared via adsorption of C-dots on PANI to be produced PANI as a core and C-dots as a shell, due to the electrostatic adsorption of carboxylic groups of C-dots on PANI. The acquired composite material shows good performance for supercapacitors with a high specific capacity of 264.6 F g− 1 at a current density of 2.5 A g− 1. The long term studies conducted on materials show that the composite based on (C-dot/PANI) remain high stability up to the tested 5000 charge–discharge cycles. The results from double-layer capacitance, cyclic voltammetry, and the impedance test display that the addition of C-dots to the PANI matrix can enhance the charge transport manner, which leads to higher supercapacitor property of the composite materials.