Abstract5-methyladenosine (m5C) modification regulates gene expression and biological functions in oncologic areas. However, the effect of m5C modification in chronic hypersensitivity pneumonitis (CHP) and idiopathic pulmonary fibrosis (IPF) remains unknown. Expression data for 12 significant m5C regulators were obtained from the interstitial lung disease dataset. Five candidate m5C regulators, namely tet methylcytosine dioxygenase 2, NOP2/Sun RNA methyltransferase 5, Y-box binding protein 1, tRNA aspartic acid methyltransferase 1, and NOP2/Sun RNA methyltransferase 3 were screened using random forest and nomogram models to predict risks of pulmonary fibrosis. Next, we applied the consensus clustering method to stratify the samples with different m5C patterns into two groups (cluster A and B). Finally, we calculated immune cell infiltration scores via single-sample gene set enrichment analysis, then compared immune cell infiltration, related functions as well as the expression of programmed cell death 1 (PD-1, PDCD1) and programmed death protein ligand-1 (PD-L1, CD274) between the two clusters. Principal component analysis of m5C-related scores across the 288 samples revealed that cluster A had higher immune-related expression than B. Notably, T helper cell (Th) 2 type cytokines and Th1 signatures were more abundant in clusters A and B, respectively. Our results suggest that m5C is associated with and plays a crucial role in development of pulmonary fibrosis. These m5C patterns could be potential biomarkers for identification of CHP and IPF, and guide future development of immunotherapy or other new drugs strategies for pulmonary fibrosis.