A reduced graphene oxide/platinum(II) tetraphenylporphyrin nanocomposite (RGO/Pt-TPP)-modified glassy carbon electrode was developed for the selective detection of hydrazine. The RGO/Pt-TPP nanocomposite was successfully prepared via noncovalent π–π stacking interaction. The prepared nanocomposite was characterized using nuclear magnetic resonance, electrochemical impedance, ultraviolet–visible and Raman spectroscopies, scanning electron microscopy and X-ray diffraction. The electrochemical detection of hydrazine was performed via cyclic voltammetry and amperometry. The RGO/Pt-TPP nanocomposite exhibited good electrocatalytic activity towards detection of hydrazine with low overpotential and high oxidation peak current. The fabricated sensor exhibited a wide linear range from 13 nM to 232 μM and a detection limit of 5 nM. In addition, the fabricated sensor selectively detected hydrazine even in the presence of 500-fold excess of common interfering ions. The fabricated electrode exhibited good sensitivity, stability, repeatability and reproducibility. In addition, the practical applicability of the sensor was evaluated in various water samples with acceptable recoveries. Copyright © 2017 John Wiley & Sons, Ltd.