A universal method for the preparation of high-yield and high N content porous carbide is reported. Nine type composite salts are assisted to carbonize coal tar pitch (CTP) in muffle furnace in air atmosphere. The mechanism of composite salt assisted carbonization of CTP is studied systematically. The composite salt is consist of heat labile ammonium salts component that can decompose producing gas at low temperature and stalbe inorganic salts component that can generate molten salt at high carbonization temperature. The two components can protect CTP in the whole carbonization process in air. These composite salts play the triple role of protection CTP from oxidation and combustion, activator and heteroatom source. The carbon yield is up to 50 wt%, and the scale-up experiment can also get high yield. The porous carbide prepared by NH4Cl/(NH4PO3)n has a high N content (10.39 at%) and high yield (56.0 wt%), and it exhibits an excellent specific capacitance (374.3 F g−1). In addition, the assembled ammonium ion supercapacitor with the prepared porous carbide and (NH4)3PO4 electrolyte shows high energy density (24.1 Wh kg−1). The work uncovers a universal and feasible way to prepare high carbon yield porous carbon materials with large scale industrial production in air.