Using molecular simulation, we investigate the effect of nitrogen doping on adsorption capacity and selectivity of CO 2 versus N 2 in model mesoporous carbon. We show that nitrogen doping greatly enhances CO 2 adsorption capacity; with a 7 wt % dopant concentration, the adsorption capacity at 1 bar and 298 K increases from 3 to 12 mmol/g (or 48% uptake by weight). This great enhancement is due to the preferred interaction between CO 2 and the electronegative nitrogen. The nitrogen doping coupled with the mesoporosity also leads to a much higher working capacity for adsorption of the CO 2/N 2 mixture in nitrogen-doped mesoporous carbon. In addition, the CO 2/N 2 selectivity is almost 5 times greater than in nondoped carbon at ambient conditions. This work indicates that nitrogen doping is a promising strategy to create mesoporous carbons for high-capacity, selective carbon capture.