Why do songs get stuck in our heads? Discover the science of earworms and how memory, repetition and emotion keep familiar tunes playing.
We’ve all experienced it. A song appears in our minds without invitation and refuses to leave. It might be a catchy chorus, an advertising jingle or a guitar riff we haven’t heard for decades.
But why do songs get stuck in our heads? And why does our brain insist on playing the same few notes when we’d rather be thinking about something else?
Scientists call this experience involuntary musical imagery. Most of us simply call it an earworm.
Despite the rather unpleasant name, earworms are an ordinary feature of musical memory. Surveys suggest roughly nine in ten people experience them at least weekly, although the frequency varies from person to person.
What Exactly Is an Earworm?
An earworm occurs when a fragment of music repeats in our minds without us deliberately recalling it.
Unlike choosing to remember a favourite song, an earworm seems to arrive independently of our intentions.
The experience usually involves a short section of music rather than an entire composition. Often it is a chorus, a distinctive riff or a musical hook lasting only a few seconds, repeated over and over.

Interestingly, we don’t need to hear the actual music for an earworm to begin. A familiar phrase, a particular location or even a passing thought can trigger the mental playback. It’s another example of how perception and expectation can surprise us, rather like asking why mirrors seem to reverse left and right.
The psychology behind involuntary musical imagery connects earworms to spontaneous memories and everyday thought. Many are pleasant or barely noticed; others involve songs we would never admit to liking. It’s often the irritating ones that attract our attention.
Our brains aren’t necessarily malfunctioning. They’re doing something they’re remarkably good at: recognising and recalling patterns.
How Does the Brain Keep Replaying Music?

Music engages interconnected brain systems involved in hearing, memory, attention and movement.
When we listen to a familiar melody, our brains recognise patterns of notes and rhythms. Those patterns can remain accessible long after the music has stopped.
Understanding how the brain processes and repeats familiar melodies involves the auditory cortex, which helps process sound, and memory-related networks that can bring a tune back to mind.
Researchers also discuss the phonological loop, a kind of short-term mental rehearsal space. It’s useful when we silently repeat a phone number; something similar may help a musical phrase keep circulating.
Brain research suggests that imagining music recruits some of the same systems used when hearing it. The tune feels vivid, although no music is actually playing. That gap between what we experience and what’s physically present is also part of the puzzle of why the Moon looks bigger near the horizon.
That doesn’t mean scientists have identified one simple earworm switch. A 2023 review noted that the underlying reasons music repeats involuntarily are still being investigated.
Unfortunately, a brain that’s excellent at remembering melodies can also be rather reluctant to stop rehearsing them.
Why Are Some Songs More Likely to Become Earworms?
Not every song has an equal chance of becoming lodged in our mental jukebox.

Research has linked earworms with repetitive hooks, familiar rhythms and melodic patterns that are easy to remember but distinctive enough to stand out. Changes in pitch and the spacing between notes may also matter. A Harvard Gazette discussion of earworm research explores how repetition and musical memory contribute to the phenomenon.
This helps explain why catchy tunes trigger musical earworms, although musical structure isn’t the whole story.
Repeated exposure matters too. Hearing a song frequently, or simply hearing it recently, can make its return more likely. One experiment found that unfamiliar tunes played six times produced more subsequent earworms than tunes played twice.
However, familiarity alone doesn’t guarantee an earworm. A distinctive phrase may lodge in one person’s memory and leave another completely unmoved.
And musical taste matters, though not always as we might expect. A ridiculous novelty tune can be every bit as persistent as a beloved classic. A strong guitar riff or an unmistakable electronic hook may lodge in memory even when we dislike the rest of the song.
There is no universally irresistible earworm, however much advertising executives might wish otherwise.
What Do Memory and Emotion Have to Do with Earworms?
Music has an extraordinary ability to connect with personal experiences.
A song heard during a memorable holiday, a family celebration or an important period of life may become associated with those events.

Sometimes it’s the words and their social message, rather than the melody alone, that leave the deepest impression.
The role of memory and emotion in repetitive songs helps explain why an apparently forgotten tune can suddenly return years later. A song that provokes admiration, irritation or even embarrassment may remain unusually easy to recognise.
The role of memory and emotion in repetitive songs helps explain why an apparently forgotten tune can suddenly return years later. A song that provokes admiration, irritation or even embarrassment may remain unusually easy to recognise.
Emotional associations can make musical memories particularly powerful. Yet earworms don’t always carry deep personal meaning: a recently heard tune may simply be easier for the brain to retrieve. Enjoying a song isn’t a requirement for remembering it.
They may also appear during routine activities when attention has room to wander. A tune might loop for an hour or two before another catchy melody takes its place; that passing earworm is different from remembering the same song vividly decades later. Interestingly, the same wandering attention can be productive, as we explore in why our best ideas arrive while we’re doing something else.
Our brains are excellent at making connections, even when those connections produce an unwanted soundtrack.
Can We Stop a Song Playing in Our Heads?
Trying desperately not to think about a particular tune may sometimes make it harder to ignore. And finding a song irritating doesn’t necessarily prevent it from sticking. Fortunately, most earworms disappear naturally.
If a melody becomes irritating, a few simple approaches may help:
Listen to the complete song. Hearing the ending sometimes helps people move beyond a repeating fragment.
Engage your attention elsewhere. Reading, conversation or another absorbing activity may reduce the mental repetition.
Try a different piece of music. Another melody may replace the original, although this risks exchanging one earworm for another.
Chew some gum. Small studies suggest that the movements involved may interfere with silently rehearsing a tune, although this isn’t a guaranteed remedy.
Leave it alone. Sometimes the easiest solution is to stop paying attention and allow the tune to fade.
These are possibilities rather than cures. What helps one person may do little for another.
Conclusion: Why Do Songs Get Stuck in Our Heads?
So why do songs get stuck in our heads?
The answer appears to involve musical memory, familiar patterns, recent exposure, spontaneous thought and personal associations. Scientists understand several contributing processes, but the complete explanation remains an open question. That uncertainty is a useful reminder of why nobody has all the answers.
Earworms demonstrate how readily our brains can recreate music without hearing a single external note.
They’re usually harmless, occasionally entertaining and sometimes spectacularly annoying.
Perhaps the strangest part is that a tune we once found infuriating can remain instantly recognisable twenty years later, while we struggle to remember why we walked into the kitchen.
And now, having spent several minutes thinking about catchy songs, there’s a reasonable chance your brain has selected one for its next performance.
You’re welcome. For more everyday mysteries with surprisingly factual explanations, explore our Quirky Questions collection.
