The purpose of this work is to detect the performance of carbon nanotubes with different nitrogen contents as anodes in lithium ion batteries. Carbon nanotubes with different nitrogen contents were synthesized by a floating catalyst chemical vapor deposition method. Melamine was employed as nitrogen precursor to effectively monitor nitrogen content in the nitrogen doped carbon nanotubes (CN x -NTs) and to modify their structures. X-ray photoelectron spectroscopy (XPS) was used to indicate the correlation between the nitrogen content and precursor amount. The study shows that with the increase of melamine amount, the growth rate of the tubes was enhanced and the diameter became bigger. Transmission electron microscopy (TEM) results demonstrated Bamboo-like structure of CN x -NTs. Investigation of their electrochemical properties as anodes for lithium ion batteries showed the discharge capacity of CN x -NTs anodes improved as their nitrogen concentration increased. Also, higher reversible capacities and better rate capabilities were observed. The superior electrochemical performance could be related to the high electrical conductivity and the larger number of defect sites. These performances revealed that the electrochemical activities of carbon nanotubes have been enhanced by the incorporation of nitrogen atoms.