The development of mesoporous nitrogen-doped carbons (NDCs) with high nitrogen contents and high surface areas from biomass is of significance for many applications, such as oxidation reaction catalysts, electrode materials and so on. Herein we report a simple route to prepare mesoporous NDCs via calcinating the mixture of biomass feedstocks (including glucose, cellulose and lignin) and melamine using eutectic salts of KCl and ZnCl2 as the porogen, and a series of mesoporous NDCs with nitrogen content up to 11.9% and BET specific surface area up to 1800 m(2) g(-1) were obtained. Served as metal-free catalysts for oxidation of hydrocarbons with tert-butyl hydroperoxide in aqueous phase, the mesoporous NDC with a N content of 11.4% showed the highest efficiency compared to the reported N-doped carbons. Moreover, the as-prepared NDCs were indicated to be an ideal support to immobilize noble nanoparticles (e.g., Pd, Rh, Ru, Pt), producing a series of NDC supported metal nanocatalysts with metal particle size of around 2 nm. This work opens up a new way to prepare mesoporous N-doped carbon materials with tailored properties.