BackgroundLatent tuberculosis infection (LTBI) is a significant source of active tuberculosis (ATB), yet distinguishing between them is challenging because specific biomarkers are lacking.MethodsWe analyzed four microarray datasets (GSE19491, GSE37250, GSE54992, GSE28623) from the gene expression omnibus to identify differentially expressed genes (DEGs). Using protein–protein interaction (PPI) networks and LASSO‐SVM algorithms, we selected three candidate biomarkers and evaluated their diagnostic efficacy. The expression levels of core genes were validated by RNA sequencing of healthy, ATB, and LTBI groups in a real‐world cohort. We conducted Gene Ontology and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analyses, predicted shared upstream miRNAs, constructed miRNA–hub and transcription factor (TF)–hub gene networks, and performed immune infiltration analysis.ResultsThree hub genes (SERPING1, C1QC, C1QB) were identified from 45 DEGs by PPI networks and machine learning screening. The diagnostic model based on the three hub genes had an area under the curve (AUC) value of 0.843 in the training set GSE19491 and 0.865 in the validation set GSE28623. Real‐world transcriptome sequencing confirmed the expression trends of the hub genes across healthy, LTBI, and ATB groups. GO analysis showed that the 45 hub genes were primarily associated with immune inflammatory responses and pattern recognition receptors, whereas KEGG analysis indicated enrichment in complement and coagulation cascades. The miRNA–hub and TF–hub gene network analysis identified nine miRNAs and the zinc finger TF GATA2 as potential co‐regulators of SERPING1, C1QC, and C1QB. Immune cell infiltration analysis identified significant differences in the immune microenvironment between LTBI and ATB, with macrophages and natural killer cells showing significant correlations with tuberculosis infection.ConclusionThe diagnostic model with SERPING1, C1QC, and C1QB shows promise in distinguishing LTBI from ATB, indicating its potential as a diagnostic tool.