Why Songs Get Stuck in Your Head—and How to Stop Them

Maybe it’s a commercial jingle, a TikTok song, or a new summer bop. Here’s how to trick your brain into hitting pause.
Person covering their ears with their eyes closed
Photograph: Nektarstock/Getty Images

As I’m folding laundry in the bedroom, daydreaming about bike rides, late-night swims, and long summer hikes, I hear my 11-year-old son singing in the shower 20 feet away.

“I tried so hard and got so far. But in the end, it doesn’t even matter.” And just like that, I know I’ll be singing the same refrain, maybe all week.

Experts say those few seconds of Linkin Park’s popular hit can trigger a mind trip lasting hours or even days. Fragments of a song or jingles wind up playing on repeat in your head. And as you may be aware, these “earworms” are shockingly common. According to a 2020 study of American college students, 97 percent experienced an earworm in the past month. Some tunes (“Baby Shark,” we’re looking at you!) crawl into your mind even without any audible stimuli.

“Earworms are a universal phenomenon across many different ages and cultures,” says Claire Arthur, an assistant professor at the Georgia Institute of Technology's School of Music in Atlanta. “But what distinguishes an earworm from any other memory that spontaneously pops into your head is that it recurs and repeats, often in a direct loop.”

Desperate to get “In the End” out of my head, I started watching Try Not to Laugh memes on YouTube. After one or two clips, my earworm was gone. It turns out, I’d unknowingly resorted to one of many tactics experts recommend to exterminate an earworm. These enigmatic tunes hook into our minds easily, but fortunately, there are a number of things you can do to eliminate the loop of lunacy.

What Causes Earworms

Scientists aren’t entirely sure why we get songs in our head, but they suspect that something about the mental architecture of our brains allows musical patterns to emerge and play over and over. Studies, like this one published in the journal Psychology of Music, show that earworms typically occur in response to a few basic triggers: recency, familiarity, and boredom.

“Our brain is made up of a massive complex network of neurons that store information, and when the mind is free to wander, it may unwittingly land on a song that has been encoded through recency and repetition,” says Emery Schubert, a researcher and professor at the University of New South Wales. “In fact, composers and artists who write songs intentionally build repetition into their music to boost the odds of creating an earworm.”

Scientists call earworms involuntary musical imagery, or INMI, because they burrow into our heads uninvited and without warning. At our house, we leave a local alternative-music radio station on in the background. The DJs favor a song called “Heatwaves,” by Glass Animals. Let’s just say I’m not a fan, and yet, that’s the song that frequently plays in my mind when I awaken from a dreamlike state: “Sometimes, all I think about is you. Late nights in the middle of June. Heat waves been fakin' me out. Can't make you happier now.” And I know I’ll be singing those few catchy lines while I’m brushing my teeth later that night.

Music that is simple, repetitive, and easy to sing (or hum) is most likely to get stuck. Think Miley Cyrus’ “Flowers,” and Queen’s classic “Bohemian Rhapsody,” and the title-says-it-all track “Can’t Get You Out of My Head,” by Kylie Minogue. Even the Rocky theme song can fight its way in. Nursery rhymes and kid-friendly tunes are also strong earworm contenders. They’re composed to be catchy, with an ear toward repetition, and as a result, memorization. If the “Itsy Bitsy Spider” crawls into your head, now you know why.

Who’s at Risk

It turns out that certain emotional states, such as when we’re tired or overworked, can trigger earworms. (In a Goldilocks-like quandary, you may be more vulnerable if you’re too stressed or not stressed enough—in other words, bored.) Maybe that’s why I frequently wrestled with earworms when my three sons were young. The combination of simple music and sleep deprivation created a fertile breeding ground for the pesky tunes to take hold.

“We get trapped in ironic processes. Not to think about something requires remembering what it is we’re not supposed to think about,” says James Kellaris, a marketing professor at the University of Cincinnati, also known as Dr. Earworm. “Mind experiment: Try very hard not to think about ‘Who Let the Dogs Out.’” Good luck with that!

At their core, earworms are a form of rumination, and research suggests that people who suffer from anxiety, post-traumatic stress disorder, and obsessive-compulsive disorder are more prone to earworms. “Their brains are wired to reflect and reflect and reflect,” Arthur says. There’s even a small subset of the population that suffers from earworms on steroids. Dubbed intrusive musical imagery, or IMI, these musical obsessions can last for months, even years, wreaking havoc on the person’s life and work.

(Note: If you’re wrestling with an earworm for more than 24 hours, and it’s interfering with your work or your life, talk to your health care provider. There are other, rare conditions that may be at play here, and they are treatable!)

How to Set Your Earworm Free

Most people aren’t too bothered by the occasional catchy tune playing on a loop in their heads. But sadly, earworms don’t discriminate between tunes you like and ones you despise. They don’t care if you’re happy and you know it (though they might care if you clap your hands as a disruption tactic).

If an earworm has a hold on you, scientists believe the following strategies may help obliterate it:

  • Complete the song. When you only know one part of the song, that’s the bit that gets stuck. Once you listen to the whole song all the way through, your brain gets the message that it’s complete, so there’s no need for it to repeat. Don’t have time to play the song in its entirety? Cue the applause. That’s a trick Arthur uses to signal to her mind that the song is over. “I imagine that I’m at a concert, and I hear the audience clapping and cheering in my mind,” she says.
  • Distract yourself. It turns out watching memes when you’re trying to ditch an earworm is an expert-approved strategy. Distraction, or coming up with a competing task, sound, or image—something that engages your mind—can help get rid of an INMI. “Even chewing gum can disrupt the phonological loop necessary for imagining through the song,” says Elizabeth Margulis, a professor at Princeton University and director of its music cognition lab.
  • Diversify your playlist. If you create a playlist made up of songs with varying tempos and beats, your mind may be less likely to catch on a particular tune. “When you expand your horizons and learn about different kinds of music, there’s a larger repertoire for your mind to draw upon,” Schubert says. In a pinch? Tune into the earworm eraser, a 42-second track that’s designed to disrupt the neural patterns that latch onto a catchy song. “There’s no rhythm, no melody, and it just takes up space in your phonological loop,” Arthur says.
  • Mix up the lyrics. The AI tool ChatGPT gets a lot of flak for potentially putting writers out of business, but if you’ve got an earworm, it could provide an antidote. Try this: Tell ChatGPT, “You are Weird Al Yankovic, make these lyrics funny and about Star Wars.” Want an AI-free solution? Try strategically replacing words in the song—so swap out the word “Caroline” in “Sweet Caroline” with another three-syllable word. Let’s say, “establish.” Now try singing it.

While you may be tempted to try to suppress earworms, Kellaris cautions against it. They’re like a cognitive itch. Scratching them (or in this case, fixating on how to annihilate them) will only make the episode last longer. Instead, when a pesky earworm does get trapped in your head, try to remember that “you can’t always get what you want … but if you try sometimes, you get what you need.”