How to prepare a low-cost carbon material with a high carbon dioxide (CO 2 ) adsorption performance has attracted much attention worldwide. Oil sludge, a hazardous solid waste, needs to be disposed off properly. Oil sludge pyrolysis has been proven to be an effective method for waste treatment with the production of pyrolysis oil, gas, and char. In this study, nitrogen-doped carbon (NC) was prepared and characterized based on oil sludge pyrolysis char (OSC). Specifically, NCs were generated by mixing OSC with potassium hydroxide and urea under different blending ratios of 1:3:2, 1:3:3, and 1:3:4 at 700 °C. NCs showed good surface morphology and pore structures with large specific surface areas (1056.45−1138.15 m 2 •g −1 ), pore volumes (1.54−1.63 cm 3 •g −1 ), and a wide range of pore size distribution. The best CO 2 adsorption capacity of NCs at room temperature and pressure is 3.3 mmol•g −1 under a blending ratio of 1:3:2. In addition, the CO 2 /N 2 selectivity of NCs is as high as 8.434. The adsorbent synthesized from oil sludge by a simple and low-cost method is a promising material for carbon dioxide adsorption.