To assess the association between routinely prescribed non-steroidal anti-inflammatory drugs (NSAIDs) and deaths from COVID-19 using OpenSAFELY, a secure analytical platform. We conducted two cohort studies from 1 March to 14 June 2020. Working on behalf of National Health Service England, we used routine clinical data in England linked to death data. In study 1, we identified people with an NSAID prescription in the last 3 years from the general population. In study 2, we identified people with rheumatoid arthritis/osteoarthritis. We defined exposure as current NSAID prescription within the 4 months before 1 March 2020. We used Cox regression to estimate HRs for COVID-19 related death in people currently prescribed NSAIDs, compared with those not currently prescribed NSAIDs, accounting for age, sex, comorbidities, other medications and geographical region. In study 1, we included 536 423 current NSAID users and 1 927 284 non-users in the general population. We observed no evidence of difference in risk of COVID-19 related death associated with current use (HR 0.96, 95% CI 0.80 to 1.14) in the multivariable-adjusted model. In study 2, we included 1 708 781 people with rheumatoid arthritis/osteoarthritis, of whom 175 495 (10%) were current NSAID users. In the multivariable-adjusted model, we observed a lower risk of COVID-19 related death (HR 0.78, 95% CI 0.64 to 0.94) associated with current use of NSAID versus non-use. We found no evidence of a harmful effect of routinely prescribed NSAIDs on COVID-19 related deaths. Risks of COVID-19 do not need to influence decisions about the routine therapeutic use of NSAIDs. © Author(s) (or their employer(s)) 2021. Re-use permitted under CC BY. Published by BMJ.