ImportanceHigh-flow nasal oxygen (HFNO) and noninvasive ventilation (NIV) are commonly used respiratory support therapies for patients with acute respiratory failure (ARF).ObjectiveTo assess whether HFNO is noninferior to NIV on the rates of endotracheal intubation or death at 7 days in 5 patient groups with ARF.Design, Setting, and ParticipantsThis noninferiority, randomized clinical trial enrolled hospitalized adults (aged ≥18 years; classified as 5 patient groups with ARF: nonimmunocompromised with hypoxemia, immunocompromised with hypoxemia, chronic obstructive pulmonary disease [COPD] exacerbation with respiratory acidosis, acute cardiogenic pulmonary edema [ACPE], or hypoxemic COVID-19, which was added as a separate group on June 26, 2023) at 33 hospitals in Brazil between November 2019 and November 2023 (final follow-up: April 26, 2024).InterventionsHigh-flow nasal oxygen (n = 883) or NIV (n = 883).Main Outcomes and MeasuresThe primary outcome was endotracheal intubation or death within 7 days assessed using a bayesian hierarchical model with dynamic borrowing across patient groups. Noninferiority was defined by a posterior probability of 0.992 or greater for an odds ratio (OR) less than 1.55.ResultsAmong 1800 patients, 1766 completed the study (mean age, 64 [SD, 17] years; 707 [40%] were women). The primary outcome of endotracheal intubation or death at 7 days occurred in 39% (344/883) in the HFNO group vs 38% (336/883) in the NIV group. In the immunocompromised with hypoxemia patient group, the primary outcome occurred in 57.1% (16/28) in the HFNO group vs 36.4% (8/22) in the NIV group; enrollment was stopped for futility (final OR, 1.07; 95% credible interval [CrI], 0.81-1.39; noninferiority posterior probability [NPP], 0.989). In the nonimmunocompromised with hypoxemia group, the primary outcome occurred in 32.5% (81/249) in the HFNO group vs 33.1% (78/236) in the NIV group (OR, 1.02 [95% CrI, 0.81-1.26]; NPP, 0.999). In the ACPE group, the primary outcome occurred in 10.3% (14/136) in the HFNO group vs 21.3% (29/136) in the NIV group (OR, 0.97 [95% CrI, 0.73-1.23]; NPP, 0.997). In the hypoxemic COVID-19 group, the primary outcome occurred in 51.3% (223/435) in the HFNO group vs 47.0% (210/447) in the NIV group (OR, 1.13 [95% CrI, 0.94-1.38]; NPP, 0.997). In the COPD exacerbation with respiratory acidosis group, the primary outcome occurred in 28.6% (10/35) in the HFNO group vs 26.2% (11/42) in the NIV group (OR, 1.05 [95% CrI, 0.79-1.36]; NPP, 0.992). However, a post hoc analysis without dynamic borrowing across the 5 ARF patient groups revealed some qualitatively different results in patients with COPD, immunocompromised patients, and patients with ACPE. The incidence of serious adverse events was similar (9.4% of patients in HFNO group vs 9.9% in NIV group).Conclusions and RelevanceCompared with NIV, HFNO met prespecified criteria for noninferiority for the primary outcome of endotracheal intubation or death within 7 days in 4 of the 5 patient groups with ARF. However, the small sample sizes in some patient groups and the sensitivity of the findings to the choice of analysis model suggests the need for further study in patients with COPD, immunocompromised patients, and patients with ACPE.Trial RegistrationClinicalTrials.gov Identifier: NCT03643939