Melatonin is synthesized from acetylserotonin, which is a deacetylated product of serotoinin. Simultaneous analysis of melatonin and its precursors in rat urine was performed using their (N,O)-ethoxycarbonyl/N-pentafluoropropionyl (EOC/PFP) derivatives by gas chromatography-mass spectrometry (GC-MS). The mass spectral data of acetylserotonin as mono-O-EOC/mono-N-PFP and serotonin as di-(N,O)-EOC/di-N-PFP derivatives were newly established. This method exhibited good linearity (r ≥ 0.996), repeatability (% relative standard deviation = 6.9-9.4), accuracy (% relative error = -8.9 to 8.6) with detection limits of 0.005 to 0.03 ng mL-1. This method was developed for the simultaneous measurement of melatonin and its precursors in rat urine.