There are presently no consensuses on the optimal sedation strategy for obese patients during gastrointestinal endoscopy. This study aim to explore the effects of opioid-free propofol or remimazolam balanced anesthesia on hypoxemia incidence in patients with obesity. A total of 264 patients were randomized to remimazolam + esketamine group (group R) or propofol + esketamine group (group P). Anesthesia in group P was administrated by propofol, esketamine and in group R by remimazolam, esketamine. The primary outcome was incidence of hypoxemia. Secondary outcomes were the time to loss of consciousness (LoC) and to recovery and the incidence of intraoperative and postoperative adverse reactions. We found the incidence of mild hypoxemia in group R was similar to that in group P (14.2% vs. 11.5%, p = 0.396). The incidence of severe hypoxemia in group R was significantly lower than Group P (4.2% vs. 9.2%, p = 0.019). The time to LoC in group R was longer than group P [Median (interquartile range, IQR): 53 s (45 to 61) vs. 50 s (42 to 54), p = 0.001]. The time to recovery from anesthesia in group R was less than group P [Median (IQR): 48 min (41 to 58) vs. 55.5 min (46 to 67), p<0.001]. There was no significant difference in the incidence of adverse events (p > 0.05 for all). We concluded that compared with propofol combined with esketamine, remimazolam combined with esketamine can reduce the incidence of severe hypoxemia during gastrointestinal endoscopy in obese patients.Clinical Trial Registration:www.chictr.org.cn, Identifier: ChiCTR2200065575.