Although suspicions of cancer may be raised in patients who visit the emergency department, little is known about emergency department use before a cancer diagnosis. We sought to describe emergency department use among patients in Ontario within the 90 days before confirmed cancer diagnosis and to evaluate factors associated with this emergency department use. We conducted a retrospective, population-based study of patients aged 18 years or older who had a confirmed cancer diagnosis in Ontario from 2014 to 2021 using linked administrative databases. The primary outcome was any emergency department visit within 90 days before the cancer diagnosis date. We used multivariable logistic regression to evaluate factors associated with emergency department use, such as demographics (e.g., age, sex, rurality, Ontario Health region, indicators of marginalization), comorbidities, previous emergency department visits and hospital admissions, continuity of primary care, type of cancer, and year of cancer diagnosis. We included 651 071 patients with cancer. Of these, 229 683 (35.3%) had an emergency department visit within 90 days before diagnosis, 51.4% of whom were admitted to hospital from the emergency department. Factors associated with increased odds of emergency department use before cancer diagnosis included rurality (odds ratio [OR] 1.15, 95% confidence interval [CI] 1.13-1.17), residence in northern Ontario (North East region OR 1.14, 95% CI 1.10-1.17 and North West region OR 1.27, 95% CI 1.21-1.32, v. Toronto region), and living in the most marginalized areas (material resources OR 1.37, 95% CI 1.35-1.40 and housing OR 1.09, 95% CI 1.06-1.11, v. least marginalized quintile). We observed significant variation in emergency department use by cancer type, with high odds of emergency department use among patients with intracranial, pancreatic, liver or gallbladder, or thoracic cancer. Emergency department use is common before cancer diagnosis, with about one-third of patients with cancer in Ontario using the emergency department before diagnosis. Understanding why patients visit the emergency department before cancer diagnosis is important, particularly for patients who live in rural or marginalized areas, or those who have specific cancer types.