Background: Listening to music as a means of relieving anxiety before and during endoscopy has been examined in several studies but results so far are contradictory and inconclusive. Aims: We aimed to determine whether listening to music could reduce anxiety prior to and during bronchoscopy, and whether it is influenced by the patient's preference in music. Methods: 300 patients undergoing bronchoscopy for suspected lung cancer were randomly assigned to: self-selected music, specially-designed music (MusiCureTM), or control (no sound). Spielberger's State-Trait Anxiety Inventory (STAI) was administered three times: at admission, after 20 min with or without music (preceding bronchoscopy), and shortly before discharge. The primary outcome was STAI state score after 20 min, with or without exposure to music prior to bronchoscopy. Results: On average, music reduced the STAI score by 2.5 points (95% CI, 1.1 to 4.0; p < 0.001) compared with the control group. This reduction was largest in the self-selected music group (3.4; 95% CI, 1.5 to 5.3; p < 0.001). In contrast, specially designed music did not significantly reduce STAI score (1.7; 95% CI, -0.3 to 3.6; p = 0.1). Conclusion: Listening to music reduces anxiety in patients undergoing bronchoscopy, provided that the music complies with the patient's preferences.