The coronavirus infection COVID-19 killed millions of people around the world in 2019-2022. Hospitals were in the forefront in the battle against the pandemic. This paper proposes a novel approach to assess the effectiveness of hospitals in saving lives. We empirically estimate the production function of COVID-19 deaths among hospital inpatients, applying Heckman’s two-stage approach to correct for the bias caused by a large number of zero-valued observations. We subsequently assess performance of hospitals based on regression residuals, incorporating contextual variables to convex quantile regression. Data of 187 hospitals in England over a 35-week period from April to December 2020 is divided in two sub-periods to compare the structural differences between the first and second waves of the pandemic. The results indicate significant performance improvement during the first wave, however, learning by doing was offset by the new mutated virus straits during the second wave. While the elderly patients were at significantly higher risk during the first wave, their expected mortality rate did not significantly differ from that of the general population during the second wave. Our most important empirical finding concerns large and systematic performance differences between individual hospitals: larger units proved more effective in saving lives, and hospitals in London had a lower mortality rate than the national average.