Background and purposeThe electrocardiogram (ECG) is frequently obtained in the work-up of COVID-19 patients. So far, no study has evaluated whether ECG-based machine learning models have added value to predict in-hospital mortality specifically in COVID-19 patients.MethodsUsing data from the CAPACITY-COVID registry, we studied 882 patients admitted with COVID-19 across seven hospitals in the Netherlands. Raw format 12-lead ECGs recorded within 72 h of admission were studied. With data from five hospitals (n = 634), three models were developed: (a) a logistic regression baseline model using age and sex, (b) a least absolute shrinkage and selection operator (LASSO) model using age, sex and human annotated ECG features, and (c) a pre-trained deep neural network (DNN) using age, sex and the raw ECG waveforms. Data from two hospitals (n = 248) was used for external validation.ResultsPerformances for models a, b and c were comparable with an area under the receiver operating curve of 0.73 (95% confidence interval [CI] 0.65–0.79), 0.76 (95% CI 0.68–0.82) and 0.77 (95% CI 0.70–0.83) respectively. Predictors of mortality in the LASSO model were age, low QRS voltage, ST depression, premature atrial complexes, sex, increased ventricular rate, and right bundle branch block.ConclusionThis study shows that the ECG-based prediction models could be helpful for the initial risk stratification of patients diagnosed with COVID-19, and that several ECG abnormalities are associated with in-hospital all-cause mortality of COVID-19 patients. Moreover, this proof-of-principle study shows that the use of pre-trained DNNs for ECG analysis does not underperform compared with time-consuming manual annotation of ECG features.Supplementary InformationThe online version of this article (10.1007/s12471-022-01670-2) contains supplementary material, which is available to authorized users.