Heteroatom-doped porous carbons are emerging as platforms for gas adsorption. Herein, N-doped microporous carbon (NPC) materials have been synthesized by carbonization of two pyridine ligand-based metal-organic complexes (MOCs) at high temperatures (800, 900, 1000, and 1100 °C). For NPCs (termed NPC-1- T and NPC-2- T, where T represents the carbonization temperature), the micropore is dominant, pyridinic-N and other N atoms of MOC precursors are mostly retained, and the N content reaches as high as 16.61%. They all show high Brunauer-Emmett-Teller surface area and pore volume, in particular, NPC-1-900 exhibits the highest surface areas and pore volumes, up to 1656.2 m2 g-1 and 1.29 cm3 g-1, respectively, a high content of pyridinic-N (7.3%), and a considerable amount of SO2 capture (118.1 mg g-1). Theoretical calculation (int = ultrafine m062x) indicates that pyridinic-N acts as the leading active sites contributing to high SO2 adsorption and that the higher content of pyridinic-N doping into the graphite carbon layer structure could change the electrostatic surface potential, as well as the local electronic density, which enhanced SO2 absorption on carbon edge positions. The results show great potential for the preparation of microporous carbon materials from pyridine ligand-based MOCs for effective SO2 adsorption.