Porous carbon has received great attentions for electrochemical energy storage devices. In this study, we proposed a novel and scalable method to fabricate porous carbon, which contained macro and mesopores, from sustainable biomass raw material of cotton cellulose.MgO template, which acted as pore creator, was incorporated into the cellulose-derived carbon by absorbing a Mg(NO 3 ) 2 solution in cellulose fibers with subsequent drying and carbonization processes. After removing the MgO template by acid leaching, porous carbon was produced with a specific surface area as high as 1260 m 2 g -1 . The sample showed attractive electrochemical performances as the anode material for Li ion batteries (LIBs). The carbon anode delivered a high reversible capacity of 793 mAh g -1 at a current density of 0.5 A g -1 after 500 cycles. The carbon anode also showed a high-rate capability, and a capacity of 355 mAh g -1can be obtained at a current density of 4 A g -1 . A wide comparison with literatures also showed that the cotton-derived porous carbon was among the most promising carbon-based anodes forLIBs.