Polyphosphazenes have been emerging as a new kind of potential precursor for doped carbons, which can provide heteroatom doped carbons for supercapacitor electrodes with high performances. Novel carbons with controllable heteroatoms doping, structure and morphology could be derived from polyphosphazenes with designed side groups, which are linked to the backbones of alternating phosphorus-nitrogen. We reported the synthesis of a novel crosslinked polyphosphazenes through the reaction of 4, 4’-diphenylmethane diisocyanate (MDI) and polybis(4-carboxyphenoxy)phosphazene (PBCP). The as-synthesized polymers were carbonized at different temperatures to generate a series of nitrogen-oxygen co-doping porous carbons with different percentages of nitrogen and oxygen. The as-synthesized co-doped carbons were characterized through XRD, Raman, XPS, BET and SEM to investigate the relationship between structures of carbons and the various weight ratio of PBCP/MDI. The in-situ doping porous carbons, CPP-1/1, which prepared with a PBCP/MDI weight ratio of 1/1, possesses a balanced graphitization degree, aperture structure and heteroatoms content (O 15.8 atom % , N 2.2 atom %). It exhibits the largest specific capacitance of 482 F/g at a current density of 0.5 A/g in 6M KOH aqueous electrolyte in a 3-electrodes system (268 F/g at 0.5 A/g and 199 F/g at 5 A/g in two-electrode system), which is attributed to the co-contribution of double-layer capacitance and pseudocapacitance. Moreover, it shows excellent rate capability (372 F/g remained at 5 A/g) and good cycling stability (>91% capacitance retention over 10000 cycles), which makes a promising electrode material for supercapacitors.