Antifibrotic agents have been widely used in patients with idiopathic pulmonary fibrosis (IPF). Long-term continuation of antifibrotic therapy is required for IPF treatment to prevent disease progression. However, antifibrotic treatment has considerable adverse events, and the continuation of treatment is uncertain in many cases. Therefore, we examined and compared the continuity of treatment between pirfenidone and nintedanib in patients with IPF. We retrospectively enrolled 261 consecutive IPF patients who received antifibrotic treatment from six core facilities in Gunma Prefecture from 2009 to 2018. Among them, 77 patients were excluded if the antifibrotic agent was switched or if the observation period was less than a year. In this study, 134 patients treated with pirfenidone and 50 treated with nintedanib were analyzed. There was no significant difference in patient background, discontinuation rate of antifibrotic treatment over time, and survival rate between the two groups. However, the discontinuation rate due to adverse events within one year of antifibrotic treatment was significantly higher in the nintedanib group than in the pirfenidone group (76% vs. 37%, p p = 0.016). The pirfenidone group tended to be discontinued due to acute exacerbation or transfer to another facility. The results of this study suggest that better management of adverse events with nintedanib leads to more continuous treatment that prevents disease progression and acute exacerbations, thus improving prognosis in patients with IPF.