Background Hashimoto's thyroiditis (HT) is an autoimmune thyroid disease characterized by inflammation and dysfunction of the thyroid gland, resulting in hypothyroidism, it results in impaired thyroid hormone generation and mimics hypothyroidism. The disease involves complex interactions among genetic, environmental, and epigenetic factors, particularly affecting the regulation of T regulatory (Treg) cells, including CD4 +foxp3+ T cells. Treg cells, defined as CD4 + T cells, rely on the expression of the foxp3 transcription factor, which is crucial for their development and differentiation. Disruptions in this regulation can lead to immune dysregulation and potential proinflammatory responses. The study focuses on investigating the impact of dietary patterns on the epigenetic changes in the foxp3 gene, a key player in the development of HT. The primary aim was to evaluate how eliminating gluten and casein proteins from dietary regimens may influence the methylation levels of the foxp3 gene, considering the potential link between these dietary components and the triggering of autoimmune diseases. Methods An epigenetic analysis of thefoxp3 gene in HT patients who were strictly following a dietary plan compared with the control group. For the epigenetic study, a methylation analysis experiment was conducted. Results Our findings revealed a notable reduction in foxp3 gene methylation levels among HT patients who adhered to a diet excluding casein and gluten. The control maintained normal dietary guidelines and showed no significant alterations in methylation levels. Discussion The laboratory values showed a decrease in methylation levels of the foxp3 gene, with statistical significance indicated as *p<0.005, **p<0.001, ***p<0.0001, suggesting a potential enhancement in its expression which could have profound implications for immune system regulation. Disruptions in the foxp3 pathway are crucial in the development of autoimmune disorders, where altered activity hinders the regulation of T cell (Treg) development, ultimately contributing to conditions like HT disease. These findings imply that nutritional interventions, especially for individuals with HT, could potentially be a strategy for mitigating autoimmunity through epigenetic mechanisms.