Recently, defect electrocatalysis has become a research focus with significant advances. However, the control synthesis of target defects is still challenging to date, which is prerequisite for deeply understanding the intrinsic activity origin of metal-free catalysts. Herein, inspired by the theoretical demonstration, we report a general edge-engineering strategy to fulfill controlling definitive defect configurations in carbons by the direct removal of specific nitrogen (N) doping sites, representing as one-to-one conversion; e.g., graphitic-N to divacancy (C585), pyridinic-N to separate pentagon (S-C5), and pyrrolic-N to adjacent pentagons (A-C5). Electrochemical measurements reveal that A-C5 defects prefer oxygen reduction reaction (ORR) catalysis, whereas C585 defects are more favorable toward hydrogen evolution reaction (HER). This work provides insights into the design of high-performance carbon-based catalysts based on the principles of defect formation.