Accurate emergency department (ED) triage is essential to prioritize the most critically ill patients and distribute resources appropriately. The most used triage system in the US is the Emergency Severity Index (ESI). To derive and validate an algorithm to assess the rate of mistriage and to identify characteristics associated with mistriage. This retrospective cohort study created operational definitions for each ESI level that use ED visit electronic health record data to classify encounters as undertriaged, overtriaged, or correctly triaged. These definitions were applied to a retrospective cohort to assess variation in triage accuracy by facility and patient characteristics in 21 EDs within the Kaiser Permanente Northern California (KPNC) health care system. All ED encounters by patients 18 years and older between January 1, 2016, and December 31, 2020, were assessed for eligibility. Encounters with missing ESI or incomplete ED time variables and patients who left against medical advice or without being seen were excluded. Data were analyzed between January 1, 2021, and November 30, 2022. Assigned ESI level. Rate of undertriage and overtriage by assigned ESI level based on a mistriage algorithm and patient and visit characteristics associated with undertriage and overtriage. A total of 5 315 176 ED encounters were included. The mean (SD) patient age was 52 (21) years; 44.3% of patients were men and 55.7% were women. In terms of race and ethnicity, 11.1% of participants were Asian, 15.1% were Black, 21.4% were Hispanic, 44.0% were non-Hispanic White, and 8.5% were of other (includes American Indian or Alaska Native, Native Hawaiian or other Pacific Islander, and multiple races or ethnicities), unknown, or missing race or ethnicity. Mistriage occurred in 1 713 260 encounters (32.2%), of which 176 131 (3.3%) were undertriaged and 1 537 129 (28.9%) were overtriaged. The sensitivity of ESI to identify a patient with high-acuity illness (correctly assigning ESI I or II among patients who had a life-stabilizing intervention) was 65.9%. In adjusted analyses, Black patients had a 4.6% (95% CI, 4.3%-4.9%) greater relative risk of overtriage and an 18.5% (95% CI, 16.9%-20.0%) greater relative risk of undertriage compared with White patients, while Black male patients had a 9.9% (95% CI, 9.8%-10.0%) greater relative risk of overtriage and a 41.0% (95% CI, 40.0%-41.9%) greater relative risk of undertriage compared with White female patients. High relative risk of undertriage was found among patients taking high-risk medications (30.3% [95% CI, 28.3%-32.4%]) and those with a greater comorbidity burden (22.4% [95% CI, 20.1%-24.4%]) and recent intensive care unit utilization (36.7% [95% CI, 30.5%-41.4%]). In this retrospective cohort study of over 5 million ED encounters, mistriage with ESI was common. Quality improvement should focus on limiting critical undertriage, optimizing resource allocation by patient need, and promoting equity.