Background and study aim: Although esophagogastroduodenoscopy (EGD) is a widely used technique, the procedure is often associated with discomfort. This study aimed to analyze painful situations, their frequency, and factors associated with patient discomfort during EGD. Patients and methods: This prospective observational study included patients scheduled to undergo EGD. Seven endoscopists recruited patients scheduled for EGD screening or surveillance. Each endoscopist enrolled 20 patients, performing 10 EGD procedures using ultraslim endoscopes and 10 with standard-sized endoscopes. Data regarding painful situations and frequency were collected using specialized buttons pressed by the patients during EGD. A survey about overall discomfort was conducted after the procedure. Results: We analyzed data from 140 patients. Esophageal insertion and duodenal observation were associated with the highest incidence of pressing the pain button, accounting for 59.3% and 40.7% of the cases, respectively. The factor associated with pressing the pain button during esophageal insertion was endoscopist experience (<10 years). In contrast, younger age and female sex were the factors associated with pressing the pain button during duodenal observation. In the post-procedure survey, 63.6% of patients reported discomfort. Factors associated with patient discomfort included pressing the pain button during esophageal insertion (odds ratio [OR]: 2.84, p=0.01) and previous painful EGD experience (OR: 2.41, p=0.03). Conclusions: This study provides objective data on painful situations, their frequency, and related factors during EGD. Further research and interventions focusing on pain reduction during endoscopic procedures are warranted. The results of this study will help endoscopists manage painful situations and potentially improve skills.