Background: Historically, idiopathic pulmonary fibrosis (IPF) was considered a chronic inflammation disorder, but this conception was reassessed in the past decades. Our understanding of the role of inflammation in IPF and its association with clinical significance remained incomplete.Methods: We downloaded mRNA expression data of peripheral blood mononuclear cells (PBMCs) from the Gene Expression Omnibus (GEO) repository. Inflammation-related genes (IRGs) expressed differently between IPF and control (CTRL) were determined. In this study, we systemically analyzed the expression of differently expressed IRGs by comprehensive bioinformatic analysis, and then investigated their potential prognostic values. The related prognostic gene expressions were verified in our cohort.Results: 110 differently expressed IRGs were identified in this study, including 64 upregulated and 46 downregulated IRGs. Three IRGs (S100A12, CCR7, and TNFSF4) were identified as potential hub genes for prognosis. Those genes were subsequently subjected to the construction of the prognostic models. In the results, IPF patients categorized as high risk demonstrated a poor overall survival rate compared to patients categorized as low risk. Based on this prognostic model, the area under the curve (AUC) of the survival-dependent receiver operator characteristic (ROC) for 1-year, 2-year, and 3-year survival rates was 0.611, 0.695, and 0.681, respectively, in the GSE28042 cohort. These observations were validated in the GSE27957 cohort, confirming the good prognostic effect of this model. The expression of the three genes was validated in our cohort. We also conducted a nomogram based on the three IRGs’ mRNA for quantitative IPF prognosis.Conclusion: Three IRGs (S100A12, CCR7, and TNFSF4) were identified as potential markers for the prognosis of IPF.