Background: Electroencephalography (EEG) plays an essential role in the diagnosis of seizures. EEG recording in children is done with partial sleep deprivation and sedative drugs. To compare the effectiveness of melatonin and chloral hydrate on sleep induction and EEG recording in children. Materials and methods: In a parallel blinded randomized clinical trial study, 78 patients (6 months–5 years) were included to record EEG. Patients were randomly divided into two groups to receive melatonin (0.4 mg/kg) or chloral hydrate (0.5 ml/kg). After receiving the sedative drug, the start and duration of sedation, recovery time, side effects, and epileptiform waves in the EEG were recorded. The data was analyzed using SPSS version 16, and the significance level was determined to be less than 0.05. Results: A total of 78 children, including 34 girls (43.6%) and 44 boys (56.4%) (average age of 27.15±17.15 months), were examined. Success in the induction of sedation was reported by melatonin in 36 patients (92%) and chloral hydrate in 37 patients (95%), which was similar between the two drugs (P=0.5). The start time (P=0.134) and the duration of sedation (P=0.408) were alike between the two drugs. However, compared to the chloral hydrate, the recovery time in the melatonin group was significantly shorter (P<0.001). Side effects were not seen in melatonin, while six children (15%) using chloral hydrate had mild side effects (P=0.013). Epileptiform waves in EEGs were reported to be similar and positive for melatonin in 18 children (50%) and chloral hydrate in 16 children (43%) (P=0.410). Conclusion: The findings show that using melatonin in the dose prescribed in this study had similar effects to success in inducing sedation with the minimum quantity of chloral hydrate. Regardless of the start time and duration of sedation, the shorter recovery time and the absence of side effects are the advantages of using melatonin.