Nitrogen-doped carbons with promising electrochemical performance exhibit a strong dependence on nitrogen configuration. Therefore, accurate control of nitrogen configurations is crucial to clarify their influence. Unfortunately, there is still no well-defined conversion route to finely control nitrogen configuration. Herein, we proposed the concept of 100% conversion from pyridinic to pyrrolic nitrogen in carbon materials through low-temperature pyrolysis and alkali activation of hydroxypyridine-3-halophenol-formaldehyde resins. Their dehalogenation pyrolysis promotes formation of carbon intermediates and conversion of tautomeric pyridone and hydroxypyridine into pyrrolic and pyridinic nitrogen through eliminating carbonyl and hydroxyl functionalities, respectively. Continuous thermal alkali activation introduces hydroxyl groups into carbon materials, converting pyridinic species to intermediate hydroxypyridine and pyridone; subsequently, these configurations transform to pyridinic and pyrrolic nitrogen, respectively, and finally, an excessive alkali ensures 100% conversion from pyridinic to pyrrolic nitrogen. NaOH activation for pyrrolic and pyridinic nitrogen co-doped carbon and KOH activation for model nitrogen-containing compounds including acridine, phenanthridine, and acridone further confirm that alkali activation plays an indispensable role in 100% conversion from pyridinic to pyrrolic units through the tautomeric hydroxypyridine and pyridone intermediates. Low-temperature alkali-induced controllable conversion of nitrogen configuration in carbon materials is suitable modulating nitrogen configurations for almost all nitrogen-doped carbon materials in electrochemical applications.