Honey, a widely existent biomass, consists mainly of carbohydrate and other nitrogen-containing substances such as proteins, enzymes and organic acids. It can be mixed homogeneously with mesoporous silica template for its excellent water-solubility and moderate viscosity. In this work, honey was employed as a nitrogen-containing carbon precursor to prepare nitrogen-doped ordered mesoporous carbons (OMCs). The obtained honey derived mesoporous nitrogen-doped carbons (HMNCs) with dilated interlayer spacings of 0.387–0.395 nm, narrow pore size distributions centering at around 4 nm and satisfactory N contents of 1.38–4.32 wt% offer superb dual functionality for lithium ion battery (LIB) and sodium ion battery (NIB) anodes. Tested against Li, the optimized HMNC-700 delivers a superior reversible capacity of 1359 mA h g−1 after 10 cycles at 100 mA g−1 and excellent rate capability and cycling stability of 722 mA h g−1 after 200 cycles at 1 A g−1. For NIB applications, HMNC-700 offers a high initial reversible capacity of 427 mA h g−1 and stable reversible capacity of 394 mA h g−1 at 100 mA g−1.