To derive and validate risk prediction algorithms to estimate the risk of covid-19 related mortality and hospital admission in UK adults after one or two doses of covid-19 vaccination.Prospective, population based cohort study using the QResearch database linked to data on covid-19 vaccination, SARS-CoV-2 results, hospital admissions, systemic anticancer treatment, radiotherapy, and the national death and cancer registries.Adults aged 19-100 years with one or two doses of covid-19 vaccination between 8 December 2020 and 15 June 2021.Primary outcome was covid-19 related death. Secondary outcome was covid-19 related hospital admission. Outcomes were assessed from 14 days after each vaccination dose. Models were fitted in the derivation cohort to derive risk equations using a range of predictor variables. Performance was evaluated in a separate validation cohort of general practices.Of 6 952 440 vaccinated patients in the derivation cohort, 5 150 310 (74.1%) had two vaccine doses. Of 2031 covid-19 deaths and 1929 covid-19 hospital admissions, 81 deaths (4.0%) and 71 admissions (3.7%) occurred 14 days or more after the second vaccine dose. The risk algorithms included age, sex, ethnic origin, deprivation, body mass index, a range of comorbidities, and SARS-CoV-2 infection rate. Incidence of covid-19 mortality increased with age and deprivation, male sex, and Indian and Pakistani ethnic origin. Cause specific hazard ratios were highest for patients with Down's syndrome (12.7-fold increase), kidney transplantation (8.1-fold), sickle cell disease (7.7-fold), care home residency (4.1-fold), chemotherapy (4.3-fold), HIV/AIDS (3.3-fold), liver cirrhosis (3.0-fold), neurological conditions (2.6-fold), recent bone marrow transplantation or a solid organ transplantation ever (2.5-fold), dementia (2.2-fold), and Parkinson's disease (2.2-fold). Other conditions with increased risk (ranging from 1.2-fold to 2.0-fold increases) included chronic kidney disease, blood cancer, epilepsy, chronic obstructive pulmonary disease, coronary heart disease, stroke, atrial fibrillation, heart failure, thromboembolism, peripheral vascular disease, and type 2 diabetes. A similar pattern of associations was seen for covid-19 related hospital admissions. No evidence indicated that associations differed after the second dose, although absolute risks were reduced. The risk algorithm explained 74.1% (95% confidence interval 71.1% to 77.0%) of the variation in time to covid-19 death in the validation cohort. Discrimination was high, with a D statistic of 3.46 (95% confidence interval 3.19 to 3.73) and C statistic of 92.5. Performance was similar after each vaccine dose. In the top 5% of patients with the highest predicted covid-19 mortality risk, sensitivity for identifying covid-19 deaths within 70 days was 78.7%.This population based risk algorithm performed well showing high levels of discrimination for identifying those patients at highest risk of covid-19 related death and hospital admission after vaccination.