In the present work, a simple, effective method to synthesis high-quality carbon nitride nanotubes with ∼90 nm diameter and 5–9 nm in thickness along with a high-yield (63 %) via template-free hydrothermal synthesis is reported. By using these graphitic carbon nitride nanotubes an advanced electrochemical sensor was demonstrated to selectively sense explosive 2,4-dinitrotoluene. It is demonstrated that bigger linear range towards 2,4-dinitrotoluene, sensing up to 425 μM is reported. Furthermore, the experiments demonstrated that this sensor possesses a high sensitivity not only for 2,4-dinitrotoluene but also for other nitroaromatic explosives.