Porous carbon materials doped with transition metals have emerged as promising electrode materials in the field of energy storage due to their higher theoretical capacitance and cost-effectiveness. In this study, metallic cobalt nanoparticles (Co NPs) were successfully loaded into porous carbon via one-step carbonization method for electrochemical research applications as electrode materials (Co/CM). A comparative investigation was conducted by varying the content of polystyrene microspheres (PS) to optimize the porous morphology. Scanning electron microscopy (SEM) analysis revealed that the Co/CM-3 composite displayed a plate-like porous structure, while transmission electron microscopy (TEM) confirmed the uniform loading of Co NPs within the porous carbon skeleton. The composite with the optimal PS content (Co/CM-3) exhibited a specific capacitance of up to 810 F g−1 (at 1 A g−1) in the three-electrode system. Furthermore, asymmetric supercapacitors assembled with the prepared electrode as the positive electrode and activated carbon as the negative electrode demonstrated an impressive energy density of up to 40 Wh kg−1 (at a power density of 746 W kg−1). Remarkably, the capacitance retention rate remained at 88.24 % even after 5000 consecutive charge and discharge cycles, highlighting the promising potential of this electrode material for practical applications in energy storage.