How to Get a Song Out of Your Head to Fall Asleep

Earworms at bedtime are one of the most frustrating obstacles to falling asleep, and research confirms the problem is real: your sleeping brain keeps processing musical melodies even after you drift off, which can fragment your sleep and pull you into unwanted awakenings. The good news is that several evidence-based strategies can interrupt the loop, from physical tricks like chewing gum to relaxation techniques that redirect your brain’s attention. Some of the most effective approaches are counterintuitive, and at least one popular bedtime habit actually makes the problem worse.

Why Songs Get Stuck Worse at Bedtime

Earworms happen to almost everyone. Survey research shows the experience is widespread and that the tunes involved are always songs already familiar to the person experiencing them. Most people don’t find earworms especially bothersome during the day. The trouble starts when you’re trying to fall asleep, because the mental quiet of bedtime gives the repeating melody nowhere to hide. During the day, competing sensory input and active tasks crowd out the loop. At night, with fewer distractions, the earworm takes center stage.1PubMed. Earworms (stuck song syndrome): towards a natural history of intrusive thoughts

A study from Baylor University confirmed this isn’t just a subjective annoyance. In a survey of about 200 people, those who frequently listened to music reported persistent nighttime earworms, which were tied to poorer sleep quality. A follow-up laboratory experiment with 50 participants went further: people who listened to popular songs before bed experienced earworms during nighttime awakenings, and their brain activity showed increased slow oscillation patterns in the frontal cortex, a sign that the brain was actively consolidating the musical memory while the person slept. In other words, the sleeping brain doesn’t just passively replay the song; it actively strengthens the memory of it.2PubMed Central. Bedtime Music, Involuntary Musical Imagery, and Sleep

The Instrumental Music Trap

One of the most surprising findings from that same Baylor study is that instrumental versions of songs were worse for sleep than lyrical versions. Participants who listened to instrumental-only tracks before bed experienced more nighttime earworms and showed measurably worse sleep quality on polysomnography, which records brain waves, eye movements, and muscle activity during sleep.2PubMed Central. Bedtime Music, Involuntary Musical Imagery, and Sleep

This is worth knowing because many people deliberately switch to instrumental or lo-fi playlists at bedtime, assuming they’re safer than songs with lyrics. The researchers suggested that instrumental versions may actually require more mental “filling in” by the brain, since the listener subconsciously supplies the missing lyrics or vocal melody, giving the memory consolidation process more to work with. If you’ve been using instrumental covers of pop songs as a sleep aid and wondering why you keep waking up with the tune running, this is likely why.

The practical takeaway is straightforward: if you want to listen to something before bed, avoid catchy, familiar melodies in any form. Ambient soundscapes, white noise, or nature sounds that lack a repeating melodic structure are less likely to trigger the earworm cycle. If you must listen to music, choosing something genuinely unfamiliar and structurally simple is a safer bet than an instrumental remix of a song you already know.

Chew Gum to Break the Loop

This one sounds absurd, but it has solid experimental backing. Researchers found that chewing gum significantly reduced both voluntary musical recall and involuntary unwanted musical thoughts. The mechanism involves articulatory motor programming, which is the brain system responsible for planning speech and mouth movements. When you silently “hear” a song in your head, your brain is partially engaging the same motor circuits it would use to sing or hum that song aloud. Chewing gum occupies those circuits with a competing motor task, making it harder for the earworm to sustain itself in conscious awareness.3PubMed. Want to block earworms from conscious awareness? B(u)y gum!

Obviously, chewing gum in bed isn’t ideal. Nobody wants to fall asleep with gum in their mouth. But this finding points to a broader principle: anything that engages your mouth and jaw muscles in a repetitive, low-effort way can interfere with the earworm. You could try gently clenching and releasing your jaw, pressing your tongue to the roof of your mouth in a repeating pattern, or silently mouthing a sequence of unrelated words. The goal is to give your articulatory system something else to do without requiring enough mental effort to keep you awake. Even a few minutes of this can be enough to weaken the loop before you stop and let yourself drift off.

Replace the Song With a “Cure” Tune

Some people have discovered on their own that playing a different, specific song in their head can dislodge the unwanted one. A study on how people react to involuntary musical imagery found that about 6% of participants reported using a designated “cure” song to displace earworms. Those who used this technique reported it as effective in a majority of cases.4PLoS ONE. Sticky Tunes: How Do People React to Involuntary Musical Imagery?

The trick is choosing the right replacement. Your cure song needs to be engaging enough to override the stuck tune but boring enough that it doesn’t become the new earworm. Songs with a clear resolution at the end seem to work better than songs with hooks that loop endlessly. Think of a song you know well but aren’t emotionally invested in, something that has a definitive ending rather than a catchy chorus that cycles. National anthems, simple folk songs, or slow hymns work well for many people precisely because they have a clear beginning, middle, and end and don’t provoke strong emotional engagement.

You can also try listening to the stuck song all the way through to its end, rather than fighting the fragment that’s looping. Earworms often consist of a short, incomplete section of a song, and one theory is that the brain keeps replaying it because it’s trying to “complete” the musical thought. Hearing the full resolution can sometimes satisfy whatever cognitive itch is driving the loop. This works best if you do it well before you’re actually in bed, not at the last moment when you’re trying to sleep.

Use Your Body to Redirect Your Brain

Relaxation techniques that shift your attention from mental imagery to physical sensation are genuinely effective at quieting a racing mind, and they work on earworms for the same reason they work on anxious thoughts: they give your brain an alternative focus. A study comparing progressive muscle relaxation, deep breathing, and guided imagery found that all three produced a significant increase in relaxation compared to a control group that did nothing. Progressive muscle relaxation and guided imagery both showed an immediate trend toward physiological calming, while deep breathing initially caused a brief spike in arousal before quickly settling back down.5PubMed Central. Effectiveness of Progressive Muscle Relaxation, Deep Breathing, and Guided Imagery in Promoting Psychological and Physiological States of Relaxation

Progressive muscle relaxation is especially well-suited to the earworm problem because it demands sustained attention to specific body parts. You systematically tense and release muscle groups from your toes to your forehead, focusing closely on the physical sensation in each area. This kind of detailed bodily attention is hard to maintain simultaneously with an auditory loop. Most people find the earworm fades into the background within a few minutes, and the relaxation itself helps with sleep onset.

Guided imagery works by a similar principle but shifts attention to a different sensory channel. Instead of “hearing” a song, you deliberately construct a visual and spatial scene: walking through a forest, floating on water, exploring a familiar place room by room. The more sensory detail you layer in (the texture of bark, the temperature of water, the smell of pine), the less cognitive bandwidth remains for the musical loop. The key is engaging multiple senses in the imagined scene, not just picturing a static image.

Why Fighting the Earworm Directly Makes It Worse

If you’ve ever lain in bed thinking “stop playing that song, stop playing that song,” you’ve experienced the ironic process theory of mental control in real time. Trying to suppress a thought requires monitoring for the thought you’re suppressing, which keeps the thought active in working memory. This is the same reason being told “don’t think of a white bear” makes you think of a white bear. Earworms respond to direct suppression the same way: the harder you try to silence the tune, the louder it gets.

This is why the strategies that actually work are all indirect. Chewing gum doesn’t suppress the thought; it occupies the motor system the thought depends on. A cure song doesn’t fight the earworm; it redirects the same mental process toward different content. Progressive muscle relaxation doesn’t silence your auditory imagery; it redirects your attention to a different sensory system entirely. The common thread is engagement with something else, not resistance against the earworm itself.

If you catch yourself in a suppression spiral, the simplest move is to stop fighting and instead choose one of the active redirection strategies. Even just naming what’s happening (“my brain is doing the earworm thing again, that’s normal”) can reduce the emotional charge enough to make the other techniques easier to apply.

Who Gets Hit Hardest

Not everyone is equally susceptible to bedtime earworms. Research on earworm frequency has consistently found that people who consider music important to their lives report longer earworms that are harder to control.1PubMed. Earworms (stuck song syndrome): towards a natural history of intrusive thoughts Musicians and frequent music listeners tend to experience earworms more often and more intensely than people who engage with music casually. This doesn’t mean you should stop caring about music, but it does explain why the problem feels disproportionately severe for some people.

There’s also an association between earworm frequency and traits related to obsessive thinking patterns. People who tend to get “stuck” on thoughts in general, whether worries, plans, or memories, are more likely to get stuck on musical fragments too. If you recognize yourself as someone whose mind tends to loop on things, you may need to be more deliberate about your pre-sleep routine than someone who rarely experiences intrusive thoughts of any kind.

The frequency of music exposure matters, too. The Baylor research found that people who regularly listen to music close to bedtime reported more nighttime earworms than those who don’t.2PubMed Central. Bedtime Music, Involuntary Musical Imagery, and Sleep This suggests that the simplest preventive measure is creating a buffer between your last music exposure and the time you get into bed. Even 30 to 60 minutes of non-musical activity, reading, light conversation, a podcast, can reduce the likelihood that a melody follows you into the pillow.

Building a Practical Pre-Sleep Routine

Pulling this all together into something you can actually do tonight requires sequencing. The strongest strategy combines prevention with a plan for when prevention fails.

  • Music curfew: Stop listening to catchy or familiar music at least 30 to 60 minutes before bed. If you want background audio, switch to something without a melodic structure, like rain sounds, brown noise, or a spoken-word podcast on a topic that interests you mildly but doesn’t excite you.
  • Listen through: If a specific song is already stuck before you start winding down, play it from beginning to end one time. Let the melody resolve. Then move on to non-musical activity.
  • Articulatory interference: Once you’re in bed and the earworm starts up, engage your mouth muscles. Press your tongue to the roof of your mouth rhythmically, mouth a string of unrelated words, or if you keep sugar-free gum on your nightstand, chew for a few minutes before spitting it out.
  • Cure song: If the motor trick doesn’t work, deliberately bring up a simple, resolved, emotionally neutral song in your mind. Let it play through once and end.
  • Body scan: Switch to progressive muscle relaxation, starting at your feet. The sustained bodily focus will pull your attention away from auditory processing. By the time you reach your shoulders, the earworm has typically lost its grip.

The order matters because each step escalates the level of engagement. You don’t need to run through all five every night. Most nights, the music curfew alone will prevent the problem. When it doesn’t, you have a progression of tools that get increasingly absorbing without getting stimulating enough to keep you awake.

When Earworms Signal Something Else

For most people, a bedtime earworm is an annoyance. But if you find that stuck songs are severely disrupting your sleep on a regular basis, lasting for hours despite using the strategies above, or causing significant distress, it’s worth considering whether the earworm is a symptom of a broader pattern rather than the problem itself. Chronic intrusive thoughts, including musical ones, sometimes accompany anxiety disorders and obsessive-compulsive tendencies. In those cases, the earworm is behaving like any other intrusive thought: it’s repetitive, unwanted, and resistant to voluntary control. The strategies described here still help, but they work better when combined with broader approaches to managing intrusive thought patterns, whether through cognitive-behavioral techniques, therapy, or other professional support.

Sleep disorders can also be a factor. If you’re waking frequently and noticing the earworm during those awakenings, the earworm may not be what’s waking you. The Baylor sleep study found that earworms were experienced during awakenings rather than causing them directly.2PubMed Central. Bedtime Music, Involuntary Musical Imagery, and Sleep Something else may be fragmenting your sleep, and the earworm is simply what greets you each time you surface. If you’re waking more than a couple of times per night regardless of earworms, the earworm may be the most noticeable symptom of a different underlying sleep issue worth investigating on its own.