N-doped ordered mesoporous carbon preparedviaa template method showed improved electrochemical performance as an anode material in sodium ion batteries.