 Phosphorus and oxygen co-doped carbon spheres with formaldehyde and resorcinol as precursor were successfully prepared by using phosphoric acid solution as phosphorus source and catalyst. When the pH value of applied phosphoric acid solution is set at 1.38, the spherical carbon materials can be obtained. The corresponding specific surface area can reach 739.48 m2 g−1, and the phosphorus amount can be 0.44 at.%. By contrast, bulk carbon materials were produced when the pH value increased to 3.72. The corresponding specific surface area decreased to 444.3 m2 g−1, and the phosphorus amount declined to 0.10 at.%. It is demonstrated that spherical carbon materials exhibit superior electrochemical performance. The specific capacitance can reach 297.5 F g−1 at the scan rate of 1 mV s−1. Symmetric supercapacitors were constructed with KOH and Na2SO4 as electrolytes, respectively. The specific capacitance can reach 186.8 F g−1 at the current density of 0.1 A g−1 when KOH is used as electrolyte and its energy density can reach up to 50.86 Wh kg−1. However, the stability of the device is relatively poor. In contrast, when sodium sulfate is used as the electrolyte, after 5000 cycles of constant current charge and discharge, the capacity is still 84.09% remaining, exhibiting excellent cycle stability. In addition, the energy density of the device can reach 39.4 Wh kg−1. Even when the power density is 4000 W kg−1, the energy density can still reach 10 Wh kg−1. The obtained materials show great potential for practical application.