Aim: Advanced age is an important risk factor for adverse events during procedural sedation. Remimazolam is safe and effective in adults’ gastroscopy sedation. The ideal dose and availability for elderly patients are not well known. We aim to investigate its 95% effective dose (ED95) for elderly patients undergoing gastroscopy, and to assess its safety and efficacy, with propofol as the comparison. Methods: The trial consists of two parts, patients who are over 65 and scheduled for elective outpatient painless gastroscopy were enrolled. In the first part, Dixon’s up-and-down methodology was used to determine the ED95 of remimazolam and propofol for inhibiting body movement during gastroscopic insertion, in combination with 0.2μg/kg remifentanil. In the second part, patients in each group received 0.2μg/kg remifentanil and the ED95 dose of the study drug for sedation induction, adding supplemental doses to maintain sedation depth when necessary. The primary outcome was the incidence of adverse events. The secondary outcome was the recovery time. Results: The ED95 of remimazolam and propofol induction dose were 0.204mg/kg [95% CI (0.175–0.390) mg/kg] and 1.994 mg/kg [95% CI (1. 739–5.955) mg/kg] respectively in gastroscopy. Adverse events were reported in 40.6% of patients in the remimazolam group and 83.1% in the propofol group (p<0.001), whereas the remimazolam group showed a higher incidence of hiccup(p=0.017). A shorter time to awakening (p<0.05) in the remimazolam group was observed. Conclusion: For elderly patients undergoing gastroscopy, the ED95 dose of remimazolam is a safer alternative than propofol when inducing the same sedation depth.