BackgroundThe benefits and risks of anti-acid medication in patients with idiopathic pulmonary fibrosis (IPF) remain a topic of debate. We investigated whether use of anti-acid medication at baseline was associated with differences in the natural course of disease or influenced the treatment effect of nintedanib in patients with IPF.MethodsPost-hoc analyses of outcomes in patients receiving versus not receiving anti-acid medication (proton pump or histamine-2 receptor inhibitor) at baseline using pooled data from the two Phase III randomized placebo-controlled INPULSIS® trials of nintedanib in patients with IPF.ResultsAt baseline, 406 patients were receiving anti-acid medication (244 nintedanib; 162 placebo) and 655 were not (394 nintedanib; 261 placebo). In an analysis of the natural course of IPF by anti-acid medication use at baseline, the adjusted annual rate of decline in FVC was − 252.9 mL/year in placebo-treated patients who were receiving anti-acid medication at baseline and − 205.4 mL/year in placebo-treated patients who were not (difference of − 47.5 mL/year [95% CI: –105.1, 10.1]; p = 0.1057). In an analysis of the potential influence of anti-acid medication use on the treatment effect of nintedanib, the adjusted annual rates of decline in FVC were − 124.4 mL/year in the nintedanib group and − 252.9 mL/year in the placebo group (difference of 128.6 mL/year [95% CI: 74.9, 182.2]) in patients who were receiving anti-acid medication at baseline and − 107.0 mL/year in the nintedanib group and − 205.3 mL/year in the placebo group (difference of 98.3 mL/year [95% CI: 54.1, 142.5]) in patients who were not (treatment-by-time-by-subgroup interaction p = 0.3869). The proportions of patients who had ≥1 investigator-reported acute exacerbation were 11.7% and 5.0% in placebo-treated patients, and 4.9% and 4.8% of nintedanib-treated patients, among patients who were and were not receiving anti-acid medication at baseline, respectively.ConclusionsIn post-hoc analyses of data from the INPULSIS® trials, anti-acid medication use at baseline was not associated with a more favorable course of disease, and did not impact the treatment effect of nintedanib, in patients with IPF.Trial registrationClinicalTrials.gov identifiers: NCT01335464 and NCT01335477.Electronic supplementary materialThe online version of this article (10.1186/s12931-018-0866-0) contains supplementary material, which is available to authorized users.