Background and study aims The primary objective was to measure the effect of music as an adjunct to sedation in patient anxiety levels during pediatric endoscopic examinations. Patients and methods We performed a single-blind randomized controlled trial comparing music with no music in children aged 2 to 18 years. Anxiety was measured using the Modified Yale Preoperative Anxiety Scale (m-YPAS) and the Visual Analog Anxiety Scale (VAS-anxiety). Patient perception of pain was evaluated with the Wong-Baker Faces Pain Rating Scale (WBFPRS). Patient experience, family satisfaction, and endoscopist perception of difficulty were evaluated. Sedative doses were recorded. Results A total of 51 children were randomized to the experimental group and 49 children to the control group. The mean ages were 10.5 years and 12.3 years, respectively. There were 63 % female subjects with no differences between groups. Overall, there were 85 upper endoscopies and 15 colonoscopies. In the recovery unit, the experimental group had lower average m-YPAS scores (mean score 27.7 vs 34.7; P