Most reported carbonaceous anodes of potassium-ion batteries (PIBs) have limited capacities. One approach to improve the performance of carbon anodes is edge-nitrogen doping, which effectively enhances the K-ion adsorption energy. It remains challenging to achieve high edge-nitrogen doping due to the difficulty in controlling the nitrogen dopant configuration. Herein, a new synthesis strategy is proposed to prepare carbon anodes with ultrahigh edge-nitrogen doping for high-performance PIBs. Specifically, self-assembled supermolecule precursors derived from pyromellitic acid and melamine are directly pyrolyzed. During the pyrolysis process, the amidation and imidization reactions between pyromellitic acid and melamine before carbonization enable the successful carbonization of pyromellitic acid-melamine supermolecule. The obtained 3D nitrogen-doped turbostratic carbon (3D-NTC) possesses a 3D framework composed of carbon nanosheets, turbostratic crystalline structure, and an ultrahigh edge-nitrogen-doping level up to 16.8 at% (73.7% of total 22.8 at% nitrogen doping). These features endow 3D-NTCs with remarkable performances as PIB anodes. The 3D-NTC anode displays a high capacity of 473 mAh g-1 , robust rate capability, and a long cycle life of 500 cycles with a high capacity retention of 93.1%. This new strategy will boost the development of carbon anodes for rechargeable alkali-metal-ion batteries.