Although guidelines recommend fixed cardiac troponin thresholds for the diagnosis of myocardial infarction, troponin concentrations are influenced by age, sex, comorbidities and time from symptom onset. To improve diagnosis, we developed machine learning models that integrate cardiac troponin concentrations at presentation or on serial testing with clinical features and compute the Collaboration for the Diagnosis and Evaluation of Acute Coronary Syndrome (CoDE-ACS) score (0–100) that corresponds to an individual’s probability of myocardial infarction. The models were trained on data from 10,038 patients (48% women), and their performance was externally validated using data from 10,286 patients (35% women) from seven cohorts. CoDE-ACS had excellent discrimination for myocardial infarction (area under curve, 0.953; 95% confidence interval, 0.947–0.958), performed well across subgroups and identified more patients at presentation as low probability of having myocardial infarction than fixed cardiac troponin thresholds (61 versus 27%) with a similar negative predictive value and fewer as high probability of having myocardial infarction (10 versus 16%) with a greater positive predictive value. Patients identified as having a low probability of myocardial infarction had a lower rate of cardiac death than those with intermediate or high probability 30 days (0.1 versus 0.5 and 1.8%) and 1 year (0.3 versus 2.8 and 4.2%;P< 0.001 for both) from patient presentation. CoDE-ACS used as a clinical decision support system has the potential to reduce hospital admissions and have major benefits for patients and health care providers.