COVID-19 remains a significant global concern, particularly for individuals with type 2 diabetes who face an elevated risk of hospitalization and mortality. Metformin, a primary treatment for type 2 diabetes, demonstrates promising pleiotropic properties that may substantially mitigate disease severity and expedite recovery. Our study of the gut microbiota and the mRNA expression of pro-inflammatory and anti-inflammatory T-lymphocyte subpopulations showed that metformin increases bacterial diversity while modulating gene expression related to T-lymphocytes. This study found that people who did not take metformin had a downregulated expression of FOXP3 by 6.62-fold, upregulated expression of RORC by 29.0-fold, and upregulated TBX21 by 1.78-fold, compared to the control group. On the other hand, metformin patients showed a 1.96-fold upregulation in FOXP3 expression compared to the control group, along with a 1.84-fold downregulation in RORC expression and an 11.4-fold downregulation in TBX21 expression. Additionally, we found a correlation with gut microbiota (F/B ratio and alpha-diversity index) and pro-inflammatory biomarkers. This novel observation of metformin's impact on T-cells and gut microbiota opens new horizons for further exploration through clinical trials to validate and confirm our data. The potential of metformin to modulate immune responses and enhance gut microbiota diversity suggests a promising avenue for therapeutic interventions in individuals with type 2 diabetes facing an increased risk of severe outcomes from COVID-19.