This study compares the treatment effects after six months of therapy with nintedanib and pirfenidone in patients with idiopathic pulmonary fibrosis (IPF) by comprehensively analyzing key parameters and establishing the diagnostic performance of two biomarkers, Krebs von den Lungen-6(KL-6) and CC chemokine Ligand-18 (CCL-18), to predict treatment outcomes. In a hospital-based retrospective cohort study, 75 patients diagnosed with IPF were divided into three groups based on their treatment: the newly diagnosed group, which included newly diagnosed IPF patients without receiving any antifibrotic treatment (25 patients), IPF patients on pirfenidone treatment (26 patients), and IPF patients on nintedanib treatment (24 patients). After adjustment for age, sex, body mass index, and baseline values of predicted forced vital capacity (FVCp), there was no significant difference in the rate of changes after 24 weeks of follow-up for FVCp (-0.2 ± 0.6, 0.0 ± 2.3, and 0.8 ± 3.5 ml change after 4, 12, and 24 weeks for pirfenidone) and (-1.7 ± 5.9, 1.0 ± 8.9, and 1.4 ± 9.5 ml change after 4, 12, and 24 weeks for nintedanib). CCL-18 offers a better ability to predict radiological findings than KL-6. Most side effects were minor and included diarrhea, stomach pain, skin rash, and hyperpigmentation. In conclusion, both drugs have demonstrated the capacity to postpone the beginning stages of FVCp decrease and lung function decline. There was little difference between the efficacy of nintedanib and pirfenidone. Both drugs were safe and well tolerated for the treatment of IPF.