The rate of cardiac implantable electronic device (CIED) infection is increasing with time. We sought to determine the predictors, relative mortality, and cost burden of early-, mid- and late-onset CIED infections. We conducted a retrospective cohort study of all CIED implantations in Ontario, Canada between April 2013 and March 2016. The procedures and infections were identified in validated, population-wide health-care databases. Infection onset was categorized as early (0–30 days), mid (31–182 days) and late (183–365 days). Cox proportional hazards regression was used to assess the mortality impact of CIED infections, with infection modelled as a time-varying covariate. A generalized linear model with a log-link and γ distribution was used to compare health-care system costs by infection status. Among 17 584 patients undergoing CIED implantation, 215 (1.2%) developed an infection, including 88 early, 85 mid, and 42 late infections. The adjusted hazard ratio (aHR) of death was higher for patients with early (aHR 2.9, 95% CI 1.7–4.9), mid (aHR 3.3, 95% CI 1.9–5.7) and late (aHR 19.9, 95% CI 9.9–40.2) infections. Total mean 1-year health costs were highest for late-onset (mean Can$113 778), followed by mid-onset (mean Can$85 302), and then early-onset (Can$75 415) infections; costs for uninfected patients were Can$25 631. After accounting for patient and procedure characteristics, there was a significant increase in costs associated with early- (rate ratio (RR) 3.1, 95% CI 2.3–4.1), mid- (RR 2.8, 95% CI 2.4–3.3) and late- (RR 4.7, 95% CI 3.6–6.2) onset infections. In summary, CIED infections carry a tremendous clinical and economic burden, and this burden is disproportionately high for late-onset infections.