Individuals with latent tuberculosis infection (LTBI) account for almost 30% of the population worldwide and have the potential to develop active tuberculosis (ATB). Despite this, the current understanding of the pathogenesis of LTBI is limited. The gut microbiome can be altered in tuberculosis patients, and an understanding of the changes associated with the progression from good health to LTBI to ATB can provide novel perspectives for understanding the pathogenesis of LTBI by identifying microbial and molecular biomarkers associated therewith. In this study, fecal samples from healthy controls (HC), individuals with LTBI and ATB patients were collected for gut microbiome and metabolomics analyses. Compared to HC and LTBI subjects, participants with ATB showed a significant decrease in gut bacterial α-diversity. Additionally, there were significant differences in gut microbial communities and metabolism among the HC, LTBI, and ATB groups. PICRUSt2 analysis revealed that microbiota metabolic pathways involving the degradation of purine and pyrimidine metabolites were upregulated in LTBI and ATB individuals relative to HCs. Metabolomic profiling similarly revealed that purine and pyrimidine metabolite levels were decreased in LTBI and ATB samples relative to those from HCs. Further correlation analyses revealed that the levels of purine and pyrimidine metabolites were negatively correlated with those of gut microbial genera represented by Ruminococcus_gnavus_group (R. gnavus), and the levels of R. gnavus were also positively correlated with adenosine nucleotide degradation II, which is a purine degradation pathway. Moreover, a combined signature including hypoxanthine and xanthine was found to effectively distinguish between LTBI and HC samples (area under the curve [AUC] of training set = 0.796; AUC of testing set = 0.924). Therefore, through gut microbiome and metabolomic analyses, these findings provide valuable clues regarding how alterations in gut purine and pyrimidine metabolism are linked to the pathogenesis of LTBI.IMPORTANCEThis study provides valuable insight into alterations in the gut microbiome and metabolomic profiles in a cohort of adults with LTBI and ATB. Perturbed gut purine and pyrimidine metabolism in LTBI was associated with the compositional alterations of gut microbiota, which may be an impetus for developing novel diagnostic strategies and interventions targeting LTBI.