Background: The gut microbiota is increasingly recognized as playing an important role in the development of obesity, but the influence of gender remains elusive. Using a large cohort of Chinese adults, our study aimed to identify differences in gut microbiota as a function of body mass index (BMI) and investigate gender specific features within these differences.Methods: Five hundred fifty-one participants were categorized as underweight, normal, overweight, or obese, based on their BMI. Fecal microbiome composition was profiled via 16S rRNA gene sequencing. Generalized linear model (GLM), BugBase, PICRUSt, and SPIEC-EASI were employed to assess the variabilities in richness, diversity, structure, organism-level microbiome phenotypes, molecular functions, and ecological networks of the bacterial community that associated with BMI and sex.Results: The bacterial community of the underweight group exhibited significantly higher alpha diversity than other BMI groups. When stratified by gender, the pattern of alpha diversity across BMI was maintained in females, but no significant difference in alpha diversity was detected among the BMI groups of males. An enrichment of Fusobacteria was observed in the fecal microbiota of obese males, while obese females demonstrated an increased relative abundance of Actinobacteria. Analysis of microbial community-level phenotypes revealed that underweight males tend to have more anaerobic and less facultatively anaerobic bacteria, indicating a reduced resistance to oxidative stress. Functionally, butyrate-acetoacetate CoA-transferase was enriched in obese individuals, which might favor energy accumulation. PhoH-like ATPase was found to be increased in male obese subjects, indicating a propensity to harvest energy. The microbial ecological network of the obese group contained more antagonistic microbial interactions as well as high-degree nodes.Conclusion: Using a large Chinese cohort, we demonstrated BMI-associated differences in gut microbiota composition, functions, and ecological networks, which were influenced by gender. Results in this area have shown variability across several independent studies, suggesting that further investigation is needed to understand the role of the microbiota in modulating host energy harvest and storage, and the impact of sex on these functions.