Porous and heteroatoms self-doped carbon (PHCs) materials are synthesized for the first time by employing carbonization of casein with ZnCl2 at a temperature of 800 °C. The synthesis involves a one-step solid state carbonization cum activation to synthesize PHCs with high specific surface areas and surface functionalization with nitrogen and oxygen. The textural properties of PHCs including specific surface area, pore volume and pore size can easily be controlled by adjusting the activation amounts of ZnCl2. The optimized material (PHC4) is synthesized with ZnCl2/casein impregnation ratio of 4 and it shows a high specific surface area (1080 m2 g−1) and an appreciable amount of heteroatoms, nitrogen (4.4%) and oxygen (4.7%). PHC4 exhibits a high CO2 adsorption capacity at 0 °C/1 bar (3.5 mmol g−1) and 0 °C/30 bar (15.8 mmol g−1). Additionally, the presence of heteroatoms on the surface results in enhancement of interactions between CO2 and the adsorbents which are evident from a high value of isosteric heat of adsorption (∼35 kJ mol−1) calculated using Clausius Clapeyron's equation. The reported activation synthesis strategy could be explored further to devise advanced functional nanomaterials for specific adsorption applications.