Introduction Obesity is a fast-growing public health threat worldwide, associated with significant health problems and a significant psychosocial burden for various individuals. The impact of exposure to environmental pollutants such as heavy metals and how it is related to the increased risk of obesity made us interested in evaluating the level of some heavy metals in the stool samples of obesity patients and healthy people. Also, another goal of this study is to investigate the relationship and comparison of the gut microbiome of obesity patients with the healthy group. Methods Some biochemical tests including the FBS, Lipid profile assay (Cholesterol, Triglyceride, LDL, VLDL, and HDL), the liver enzymes (AST, ALT, ALP), and Complete Blood Test (CBC) were assessed in the blood samples of the obese and control individuals. The Inductively Coupled Plasma Mass Spectrometry (ICP-MS) method was used to evaluate the level of some heavy elements in stool samples of obesity patients and healthy individuals. The biochemical tests of blood samples and ICP (Inorganic Phosphate Concentration) of stool samples were statistically compared between the obese and healthy groups utilizing GraphPad Prism software. Metagenomics sequencing based on the 16S rRNA gene sequencing was conducted to identify the alteration of the gut microbiome of obese people compared to the control group. Result The result of the biochemical analysis showed the significantly higher level of the FBS, Cholesterol, TG, LDL,VLDL, AST, ALT, ALP, and Lymphocytes (p<0.05). The ICP results showed significantly higher concentration of the Cd, Zn, Fe, Mn, and P , and lower concentration of Ba, V, W, Ti, Ge, Nd, and S in the feces samples of the obese compared to the control group (p<0.05). The gut microbiome analysis showed that the Bifidobacteriaceae, Ruminococcaceae, and Coriobacteriaceae were the bacterial families with most abundances in the three obese, lean, and control groups. There were no significant differences in the abundances of three bacterial families between groups (p>0.05).The differences between Firmicutes/ Bacteroides (F/B) ratios in the three groups were not significant (p>0.05). The species richness based on the alpha diversity (Chao1 index) indicated the same species diversity in the three groups and there were not any significant differences between species diversity of three groups (p=0.3 >0.05). Beta diversity analysis showed significant difference of Bray-Curtis diversity in the obese and lean groups compared to the control group (p<0.0001) and no significant difference was found between obese and lean group (p=0.141). The result showed a negative correlation of Bifidobacteriaceae abundance v.s Cadmium concentration (r= -0.6629, CI: -0.8720 to -0.2490, p= 0.0051), and a positive correlation of BMI v.s Bacteroides (r=0.5851, CI:0.1101 to 0.8425, p=0.0190).Conclusion Elevated levels of the biochemical indicators and excretion of some heavy metals in feces highlight possible links between environmental exposure and obesity. Despite similarities in bacterial family abundances and species diversity across obese, lean, and control groups, there was more phylogenetic distance between the control group (normal BMI) with two other obese and lean groups (abnormal BMI).These findings emphasize the multifaceted nature of factors contributing to obesity and underscore the importance of investigating environmental influences on health outcomes.