High-level heteroatom, N and S, dual-doped graphene with an improved mesoporous structure was fabricated via facile in situ carbonization and used as metal-free cathode for non-aqueous lithium oxygen batteries. The prepared cathode delivered an ultrahigh specific capacity of 22,252 mAh/g at a current density of 200 mA/g as well as better cycling reversibility because of the larger and copious mesopores, which can promote the penetration of oxygen, electrons, and lithium ions and the ability to accommodate more discharge products, e.g., Li2O2, in Li–O2 batteries. The material had a high level of heteroatom co-doping in the carbon lattice, which enhanced the electrical conductivity and served as active sites for the oxygen reduction reaction.