The study aims to evaluate the correlations between gut microbiota and biochemical markers in patients with type 2 diabetes mellitus and thyroid dysfunction. The study included 82 patients with type 2 diabetes mellitus, obesity, and thyroid dysfunction. We performed various tests on the stool samples of the patients to analyze the composition of the gut microbiota and also measured several biochemical parameters related to carbohydrate, lipid, and thyroid metabolism, as well as insulin resistance. Statistical methods to compare and correlate the variables were used. A number of significant correlations were found between the gut microbiota and the biochemical markers in the patients. We observed that some bacteria and fungi, such as Bifidobacterium spp., Candida krusei, and Helicobacter pylori, were associated with thyroid parameters, such as TSH, fT4, and TRAb. It was also detected that some bacteria, such as Actinobacteria, Enterococcus spp., Shigella spp., and Salmonella spp., were related to carbohydrate metabolism parameters, such as glucose, HbA1c, and HOMA-IR. As a conclusion, the gut microbiota may impact the functioning of the thyroid gland and the carbohydrate metabolism in patients with type 2 diabetes mellitus and thyroid dysfunction. We suggest that further studies are needed to explore the mechanisms and implications of these interactions, and to evaluate the potential of modulating the gut microbiota as a therapeutic strategy.