Introduction: Endoscopy is one of the invasive medical methods for diagnosing gastrointestinal disorders that cause anxiety in patients. The aim of this study was to determine the effect of guided imagery on anxiety in patients undergoing endoscopy. Methods & Materials: In this two-group clinical trial study, 60 endoscopic candidate patients referred to 22 Bahman Hospital in Gonabad were selected by convenience sampling and randomly divided into two groups of intervention (n = 30) and control (n = 30). At the beginning of the study, the Spielberger Anxiety Inventory and demographic Information, were completed. For patients in the intervention group, one hour before endoscopy, the guided imagery audio file was played through headphones for 20 minutes. The control group received only routine care. Immediately before the intervention, the anxiety questionnaire was completed again and the data were analyzed using SPSS 16 software and statistical tests. Results: The results of the study showed that there was no statistically significant difference between the intervention and control groups in terms of anxiety before the intervention (P> 0. 05) but there was a significant difference after the intervention (P = 0. 001). Also, the mean scores of hidden and obvious anxiety after the intervention in the intervention group was significantly reduced compared to the control group (P = 0. 002). Conclusion: Guided imagery reduces the anxiety of endoscopic candidate patients. Therefore, this non-pharmacological method can be used to reduce patients' anxiety before endoscopy.