Background Idiopathic pulmonary fibrosis (IPF) is a rare disease, and estimates of incidence and prevalence vary considerably by geographic region. There have been few studies of patient populations with IPF in Sweden and here we describe the first national cohort of patients with pulmonary fibrosis. Methods A retrospective longitudinal study with linked datasets from Swedish population-based registers and electronic medical records from 2001–2017. Included patients had a registration of International Classification of Diseases, Tenth Revision (ICD-10) code J84.1, were aged ≥40 years and did not have a competing diagnosis after the initial J84.1 code; a diagnosis algorithm was used to refine the population for patients with IPF. This national cohort was based on linked patient-level data from national, population-based health registers. Objectives To describe incidence of pulmonary fibrosis and clinical characteristics (comorbidities and concomitant medications) at diagnosis and at any time. Results Cohort 1 included 17 244 patients with pulmonary fibrosis. Incidence of pulmonary fibrosis ranged from 10.4–15.4 cases per 1 00 000 per year between 2001 and 2015, with an incidence of 13.9 cases per 1 00 000 per year in 2015. Incidence increased with age and was higher in males. Patients had a mean (standard deviation [SD]) age of 74.6 (10.5) years at time of diagnosis and 62.5% were male. Clinical characteristics of these patients are shown in the table; patients had a mean (SD) Charlson comorbidity index of 1.4 (1.7). Conclusions Analysis of the first national cohort of patients with pulmonary fibrosis in Sweden has found slightly higher incidence rates of IPF than those of previous studies, though this may be due to identification of patients with IPF using ICD-10 code J84.1 (’other interstitial pulmonary diseases with fibrosis’). Though a diagnosis algorithm was used to refine the population for those with IPF, these criteria might not exclude all patients with non-IPF interstitial lung diseases. The frequencies of clinical characteristics in this population were broadly in line with those previously observed in patient populations with IPF.