Transition‐metal phosphates have been widely applied as promising candidates for electrochemical energy storage and conversion. In this study, we report a simple method to prepare a N, F co‐doped mesoporous cobalt phosphate with rich‐oxygen vacancies by in‐situ pyrolysis of a Co‐phosphate precursor with NH4+ cations and F− anions. Due to this heteroatom doping, it could achieve a current density of 10 mA/cm2 at lower overpotential of 276 mV and smaller Tafel slope of 57.11 mV dec−1 on glassy carbon. Moreover, it could keep 92 % of initial current density for 35 h, indicating it has an excellent stability and durability. Furthermore, the optimal material applied in supercapacitor displays specific capacitance of 206.3 F g−1 at 1 A ⋅ g−1 and maintains cycling stability with 80 % after 3000 cycles. The excellent electrochemical properties should be attributed to N, F co‐doping into this Co‐based phosphate, which effectively modulates its electronic structure. In addition, its amorphous structure provides more active sites; moreover, its mesoporous structure should be beneficial to mass transfer and electrolyte diffusion.