Abstract Background Epilepsy is a neurological disorder characterized by recurrent seizures. A mechanism of cell death regulation, known as ferroptosis, which involves iron-dependent lipid peroxidation, has been implicated in various diseases, including epilepsy. Objective This study aimed to provide a comprehensive understanding of the relationship between ferroptosis and epilepsy through bioinformatics analysis. By identifying key genes, pathways, and potential therapeutic targets, we aimed to shed light on the underlying mechanisms involved in the pathogenesis of epilepsy. Materials and methods We conducted a comprehensive analysis by screening gene expression data from the Gene Expression Omnibus (GEO) database and identified the differentially expressed genes (DEGs) related to ferroptosis. Gene Ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) analyses were performed to gain insights into the biological processes and pathways involved. Moreover, we constructed a protein–protein interaction (PPI) network to identify hub genes, which was further validated using the receiver operating characteristic (ROC) curve analysis. To explore the relationship between immune infiltration and genes, we employed the CIBERSORT algorithm. Furthermore, we visualized four distinct interaction networks—mRNA–miRNA, mRNA–transcription factor, mRNA–drug, and mRNA–compound—to investigate potential regulatory mechanisms. Results In this study, we identified a total of 33 differentially expressed genes (FDEGs) associated with epilepsy and presented them using a Venn diagram. Enrichment analysis revealed significant enrichment in the pathways related to reactive oxygen species, secondary lysosomes, and ubiquitin protein ligase binding. Furthermore, GSVA enrichment analysis highlighted significant differences between epilepsy and control groups in terms of the generation of precursor metabolites and energy, chaperone complex, and antioxidant activity in Gene Ontology (GO) analysis. Furthermore, during the Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway analysis, we observed differential expression in pathways associated with amyotrophic lateral sclerosis (ALS) and acute myeloid leukemia (AML) between the two groups. To identify hub genes, we constructed a protein–protein interaction (PPI) network using 30 FDEGs and utilized algorithms. This analysis led to the identification of three hub genes, namely, HIF1A, TLR4, and CASP8. The application of the CIBERSORT algorithm allowed us to explore the immune infiltration patterns between epilepsy and control groups. We found that CD4-naïve T cells, gamma delta T cells, M1 macrophages, and neutrophils exhibited higher expression in the control group than in the epilepsy group. Conclusion This study identified three FDEGs and analyzed the immune cells in epilepsy. These findings pave the way for future research and the development of innovative therapeutic strategies for epilepsy. Keywords: ferroptosis, epilepsy, bioinformatic analysis, differentially expressed genes, immune landscape 1. Introduction Epilepsy is a chronic neurological disorder characterized by recurrent and unpredictable seizures. Seizures are caused by abnormal electrical activity in the brain, which can result in sudden and uncontrolled bursts of abnormal brain cell firing, leading to various symptoms ([35]1, [36]2). These symptoms can be mild, such as brief periods of impaired consciousness, confusion, or altered sensations. They can also be severe, including muscle convulsions, fainting, loss of consciousness, generalized convulsions, and foaming at the mouth ([37]3). In recent years, our understanding of the pathogenesis of epilepsy has deepened, although the exact mechanisms behind its onset are still unclear ([38]4). To provide more precise guidance for preventing and treating epilepsy, it is necessary to unravel its pathogenesis at the molecular level. In this study, we utilized a dataset of epilepsy from the Gene Expression Omnibus (GEO) database and conducted bioinformatics analysis on the genes associated with epilepsy. Ferroptosis is a similar form of cell death with distinctive biological features to other common cell death mechanisms. A prominent feature of ferroptosis is the accumulation of free iron within cells resulting in an irreversible lipid peroxidation reaction ([39]5). Excessive accumulation of intracellular ions can lead to lipid oxidation, membrane damage, and functional impairment, ultimately resulting in cell death. Factors involved in the regulation of ferroptosis include lipid peroxidation products, antioxidants, and iron-related proteins, as well as molecules and pathways associated with cell survival and death ([40]6). Significant progress has been made in the study of ferroptosis, particularly in understanding its regulatory mechanisms, related signaling pathways, and its association with the development of epilepsy ([41]7, [42]8). These studies contribute to elucidating the deeper mechanisms underlying cell death and provide theoretical and practical foundations for developing novel therapeutic approaches for epilepsy. Gene set variation analysis (GSVA) is a non-parametric unsupervised analysis method primarily used to transform gene expression matrices into gene set expression matrices for the evaluation of transcriptional enrichment of different metabolic pathways among different samples ([43]9, [44]10). To investigate the biological process variations between epilepsy patients and normal controls, the R package “GSVA” can be employed for gene set variation analysis based on gene expression profiling datasets from different epilepsy patients and normal controls. Ferroptosis plays an important role in epilepsy, and this research aims to identify key genes associated with epilepsy and ferroptosis, which may serve as novel biomarkers or possible therapeutic targets for epilepsy. In this study, the CIBERSORT algorithm was performed to evaluate the immune infiltration characteristics of epilepsy and normal samples in the integrated dataset ([45]GSE32534 and [46]GSE143272), assessing the composition of 22 immune cell types in each group. The selected hub genes were then associated with the levels of immune cell infiltration using Pearson correlation coefficients and significance levels. Finally, a compound network, drug network, mRNA–miRNA network, and transcription factor network of the three hub genes were constructed. This study provides a research foundation for exploring potential regulatory targets and possible mechanisms of epilepsy, offering new insights into the treatment of this disease. 2. Materials and methods 2.1. Data source and preprocessing Ferroptosis genes were selected from the GeneCards database ([47]11). Gene expression data of epilepsy including [48]GSE32534 and [49]GSE143272 were obtained from the Gene Expression Omnibus (GEO) database ([50]12, [51]13). [52]GSE32534 is based on the [53]GPL570 platform, which includes 10 tissue samples, with five being Epilepsy patients and five being normal controls. The other dataset [54]GSE143272 is based on the [55]GPL10558 platform and includes 34 epilepsy patients and 50 normal controls. The detailed information on both datasets is shown in [56]Table 1. Table 1. Data set information. ID GPL Sample source Sample size References Species