Objectives The steroid hormone vitamin D has roles in immunomodulation and bone health. Insufficiency is associated with susceptibility to respiratory infections. We report 25-hydroxy vitamin D (25(OH)D) measurements in hospitalised people with COVID-19 and influenza A and in survivors of critical illness to test the hypotheses that vitamin D insufficiency scales with illness severity and persists in survivors.Design Cross-sectional study.Setting and participants Plasma was obtained from 295 hospitalised people with COVID-19 (International Severe Acute Respiratory and emerging Infections Consortium (ISARIC)/WHO Clinical Characterization Protocol for Severe Emerging Infections UK study), 93 with influenza A (Mechanisms of Severe Acute Influenza Consortium (MOSAIC) study, during the 2009–2010 H1N1 pandemic) and 139 survivors of non-selected critical illness (prior to the COVID-19 pandemic). Total 25(OH)D was measured by liquid chromatography-tandem mass spectrometry. Free 25(OH)D was measured by ELISA in COVID-19 samples.Outcome measures Receipt of invasive mechanical ventilation (IMV) and in-hospital mortality.Results Vitamin D insufficiency (total 25(OH)D 25–50 nmol/L) and deficiency (