ObjectiveTo compare the efficacy and safety of inpatient and outpatient initiation ketogenic diet (KD) protocol of pediatric refractory epilepsy.MethodsEligible children with refractory epilepsy were randomly assigned to receive KD with inpatient and outpatient initiation. The generalized estimation equation (GEE) model was used to analyze the longitudinal variables of seizure reduction, ketone body, weight, height, body mass index (BMI), and BMI Z-score at different follow-up times between the two groups.ResultsBetween January 2013 and December 2021, 78 and 112 patients were assigned to outpatient and inpatient KD initiation groups, respectively. There were no statistical differences between the two groups based on baseline demographics and clinical characteristics (allPs > 0.05). The GEE model indicated that the rate of reduction of seizures≥50% in the outpatient initiation group was higher than that of the inpatient initiation group (p= 0.049). A negative correlation was observed between the seizure reduction and blood ketone body at 1, 6, and 12 months (allPs< 0.05). There were no significant differences in height, weight, BMI, and BMI Z-score between the two groups over the 12-month period by the GEE models (allPs > 0.05). Adverse events were reported by 31 patients (43.05%) in the outpatient KD initiation group and 46 patients (42.20%) in the inpatient KD initiation group, but these differences were not statistically significant (p= 0.909).ConclusionOur study shows that outpatient KD initiation is a safe and effective treatment for children with refractory epilepsy.