This study investigated the effects of a ketogenic diet (KD) on the gut microbiota of children with mitochondrial epilepsy. Fecal samples were collected before and after a 3-month KD intervention. 16S rRNA sequencing revealed that KD reduced Firmicutes abundance and increased Bacteroidota abundance, with a significant increase in Bacteroides fragilis. Functional analysis showed differences in 12 KEGG pathways at level 3, suggesting KD alters gut microbiota composition and function. These changes may serve as biomarkers for KD's therapeutic effects.