A song stuck in your head at bedtime isn’t just annoying. It can measurably worsen your sleep. A 2021 study from Baylor University found that people who frequently experience nighttime earworms had worse sleep quality, and brain imaging showed their sleeping brains continued processing the melody even after they fell asleep. The good news: a few targeted tricks can break the loop and let you drift off.
Why Your Brain Replays Songs at Night
Earworms rely on the same brain regions involved in hearing and inner speech. When you listen to a catchy song, your auditory cortex and frontal cortex stay activated even after the music stops. Your brain essentially keeps “singing” the song internally through a process called subvocalization, the same silent speech mechanism you use when reading to yourself or rehearsing what you’ll say in a conversation.
Two cognitive quirks make this worse at bedtime. First, there’s a recency effect: the more recently or repeatedly you heard a song, the more primed your memory is to replay it. Second, there’s what psychologists call the Zeigarnik effect, where unfinished tasks stick in your mind longer than completed ones. If you only heard part of a chorus, or if the song faded out before a satisfying resolution, your brain treats it like an open loop and keeps circling back to it.
At night, when external stimulation drops and your mind has nothing else to latch onto, these loops become louder. The Baylor study confirmed this by measuring frontal slow oscillation activity during sleep, a marker of memory consolidation. Participants who experienced earworms showed significantly more of this activity, meaning the sleeping brain was actively reinforcing the musical memory rather than letting it fade.
The Chewing Gum Trick
The most well-supported physical technique for stopping an earworm is surprisingly simple: chew gum. Researchers at the University of Reading ran three experiments testing this and found that chewing gum consistently reduced both voluntary and involuntary musical thoughts. The effect wasn’t about distraction or keeping your mind busy. It specifically disrupted the articulatory motor system, the same jaw, tongue, and throat muscles involved in subvocalization. By occupying that system with chewing, the brain loses its ability to “hear” the inner music clearly.
The researchers confirmed this by comparing gum chewing to simple finger tapping. Tapping didn’t work nearly as well, because it doesn’t engage the vocal motor system. Chewing gum directly interferes with the mechanism your brain uses to replay the melody. If you’re already in bed and don’t want to chew gum, any activity that engages your mouth and jaw in a repetitive way (silently mouthing random words or numbers, for instance) may produce a similar effect.
Listen to the Full Song
Because unfinished melodies stick around longer than completed ones, one counterintuitive strategy is to get up and listen to the entire song from start to finish. This closes the open loop. Your brain no longer treats the fragment as an unresolved task, and the urge to replay it often fades. If you only have a chorus stuck on repeat, hearing the full track through to its natural ending can signal to your memory system that the “task” is done.
Replace the Loop With Words
Since earworms depend on your brain’s inner speech system, you can crowd them out by loading that system with something else. Reading a few pages of a book (a physical one, to avoid screen light) forces your subvocalization system to process language instead of music. Mentally reciting something familiar, like a grocery list or the lyrics to a completely different, slower song, can also overwrite the loop.
The key is choosing something low-energy and non-catchy. Swapping one earworm for another defeats the purpose. Mundane, non-rhythmic content works best: a boring paragraph, a sequence of numbers, or a visualization exercise where you narrate a scene to yourself in detail.
Rethink Your Pre-Sleep Music Habits
Many people use music to unwind before bed, but the type of music matters more than you might expect. The Baylor study tested this directly by having participants listen to either lyrical or instrumental versions of popular songs before sleep. Instrumental versions triggered earworms in 52% of participants, compared to just 28% for the lyrical versions. That’s roughly double the risk.
This seems backward, since you’d expect words to be stickier. But the researchers suggest that catchy instrumental melodies may be easier for the brain to loop because there’s less verbal content anchoring the memory to a “finished” narrative. The melody floats free and replays more easily. If you listen to music before bed, songs with lyrics may actually be the safer choice. Better yet, stop listening to any upbeat or catchy music at least 30 to 60 minutes before you plan to sleep. Podcasts, audiobooks, or ambient sounds (rain, white noise) engage the auditory system without creating a melodic loop.
Engage Your Working Memory
Earworms persist partly because your working memory has spare capacity to replay them. When you’re lying in the dark doing nothing, your short-term memory has no competing task, so the melody fills the gap. Giving your working memory a mild challenge can push the song out.
One technique is to visualize a slow, detailed scene: walk through your childhood home room by room, or imagine yourself preparing a complex recipe step by step. This loads your spatial and verbal working memory without being stimulating enough to keep you awake. Another option is counting backward from 1,000 by sevens. It’s just boring and demanding enough to prevent your brain from wandering back to the chorus.
What Not to Do
Actively trying to suppress the song almost always backfires. Thought suppression research consistently shows that forcing yourself not to think about something makes it more persistent, not less. The more you tell yourself “stop playing that song,” the more your monitoring system checks whether the song is still there, which reactivates it. Every strategy above works by replacing the earworm with a competing activity, not by fighting it directly. Accept that the song is there, then redirect your brain’s resources elsewhere. The melody fades when it has nothing left to feed on.