Heteroatom-doped carbon (HDC) has attracted tremendous attention due to its promising application in energy conversion and storage. Herein, due to its abundance high rate of reproduction, the microorganism, Bacillus subtilis, is selected as a precursor. An effective ionothermal process is adopted to produce the HDCs. Using acid activation, the obtained sample exhibits excellent electrocatalytic activity, long-term stability, and excellent resistance to crossover effects in oxygen reduction. Additionally, the base-treated sample exhibits superior performance in capacitors to most commercially available carbon materials. Even at a high current density, a relatively high capacitance is retained, indicating a great potential for direct application in energy storage.