Written by the Nuvirox Research Team
Key points
- Around a quarter of participants in a laboratory study woke with a song playing in their head, hours after any music had stopped.
- Bedtime earworms went with worse polysomnography-measured sleep — and instrumental versions of songs caused more of them than the lyrical originals.
- The leading explanation is spontaneous memory reactivation: the sleeping brain rehearses recently encoded material, and melodies are unusually rehearsable.
Short answer: your brain is rehearsing a memory, and music is built to be rehearsed. An earworm at bedtime is involuntary musical imagery — a melodic fragment looping without your consent. It shows up at night because the conditions are perfect: no competing input, no task demanding attention, and a brain moving into a state where recently encoded material gets spontaneously reactivated. The best experimental work on this found bedtime earworms tracked with objectively worse sleep, and produced a genuinely surprising result about which kind of music causes them.
What is an earworm, technically?
Researchers call it involuntary musical imagery: the experience of a tune arriving in the mind and repeating without conscious control. It is extremely common while awake, and the fragments involved are usually short, repetitive and drawn from music heard recently or heard many times before.
What makes music unusually good at this is its structure. A melodic phrase has a strong internal logic — each note implies the next — so once a fragment starts, it carries itself forward. Unfinished phrases are particularly sticky, which is why earworms often loop on a hook rather than playing a song through to its end.
At night the phenomenon changes character. Awake, an earworm competes with everything else demanding your attention and usually loses within minutes. Lying in a dark, quiet room, it has no competition at all — the same reason embarrassing memories surface at bedtime and racing thoughts get louder.
What the laboratory study found
Scullin and colleagues ran two studies, one survey and one experiment. In the first, 199 adults with a mean age of about 36 reported their music habits and sleep. People who listened to music frequently reported more persistent night-time earworms, and having those earworms was associated with worse sleep quality.
The experiment is the more informative half. Fifty participants with a mean age of about 21 came into the sleep laboratory. Before bed they heard three familiar, catchy pop songs. Participants were randomly assigned to hear either the original lyrical versions or de-lyricised instrumental versions of the same tracks. Sleep was then recorded with polysomnography.
Study snapshot
| Design | Randomised laboratory experiment with polysomnography |
| Participants | 50 adults, mean age 21.2 |
| Manipulation | Lyrical vs. instrumental versions of the same songs before bed |
| Key finding | Instrumental versions produced more night-time earworms |
| Sleep effect | Earworms accompanied by worse measured sleep quality |
The result ran opposite to the obvious prediction. Instrumental music — the version most people would assume is gentler and less intrusive — increased the incidence of night-time earworms and worsened polysomnography-measured sleep. About a quarter of participants reported waking with a song in their head, which the authors described as striking given that no music had played for around eight hours and nothing in the room could have prompted it.
There was a physiological signature too. Participants who experienced a sleep earworm showed more slow oscillations during sleep, a marker associated with memory reactivation, and the increase was concentrated over the region corresponding to auditory cortex. That is the strongest available evidence that the sleeping brain is actively replaying the melody rather than simply failing to let go of it.
The honest counterweight: these are two studies from one laboratory, the experiment had 50 participants, and the survey half is correlational — people who sleep badly may simply notice earworms more. The effect has not been widely replicated. It is suggestive and mechanistically coherent rather than settled.
Why would the brain replay music during sleep?
Sleep is when recently encoded memories are consolidated, and one component of that process appears to involve spontaneous reactivation of the material. Slow oscillations are part of the machinery. If you have spent the evening encoding a melody, that melody is among the material available for reactivation, and unlike a fact or a face it has a temporal structure that unfolds — so reactivating it feels like hearing it.
This also explains why earworms cluster at awakenings rather than being reported as a continuous overnight experience. You only have access to what is happening in your mind at moments when you surface. The music may be being reactivated repeatedly; you only catch it when you briefly wake.
What makes a song more likely to stick
Familiarity is the strongest factor. Songs you know well are already encoded, so a brief exposure is enough to reactivate a complete representation. Repetition within the song matters too, as does a tempo close to a comfortable walking pace, and a simple, singable contour.
Recency and frequency of exposure both raise the odds, which is why earworms spike when a song is inescapable on the radio, and why the people who listen to the most music report the most night-time earworms. Emotional salience and unexpected exposure — hearing a fragment in a shop, for instance — also seem to help fix a tune in place.
What actually helps
Complete the song. There is reasonable support for the idea that unfinished musical phrases persist because they are unresolved, and that hearing or mentally running the tune through to its ending can release it. This is the opposite of the usual advice to suppress the thought, which tends to backfire for intrusive content generally.
Displace it with a different, undemanding verbal task. Anything mildly engaging that uses the same processing resources — a word puzzle, reading a few pages, silently reciting something — competes with the loop more effectively than trying not to think about it. The same principle underlies imagery distraction techniques.
Change the input at bedtime. If you routinely listen to music in the hour before sleep, the experimental evidence suggests moving it earlier, and specifically not assuming that an instrumental playlist is the safe option. Our wider discussion of whether music helps you fall asleep covers what the trials show on the other side of that ledger.
If your bedroom is quiet enough that any internal noise dominates, a low, structureless sound layer can help by giving attention something neutral to settle on — the logic behind white noise. Structure is the enemy here, so this is one case where music is the wrong tool.
When it is worth mentioning to a doctor
Earworms are a normal experience and almost never a sign of anything. Two situations warrant a conversation. The first is if the internal music is continuous, unusually vivid, or feels externally located rather than in your head — that is a different phenomenon and worth describing accurately to a clinician. The second is if it is accompanied by ringing or buzzing you can hear during the day, which points toward tinnitus rather than musical imagery.
Persistent intrusive thoughts that cause real distress, musical or otherwise, are also worth raising, particularly if they come with rituals or significant anxiety.
Frequently asked questions
Why does it always happen right as I am trying to sleep?
Because that is when nothing else is competing for your attention. The earworm is probably running at low intensity at other times too; a dark, quiet room simply removes everything that would otherwise drown it out.
Does listening to the song all the way through really help?
For many people, yes. The reasoning is that incomplete phrases persist because they are unresolved. It is a low-cost thing to try, though it works better earlier in the evening than at 2am when you do not want the stimulation.
Is an earworm a sign of anxiety?
Not in itself. Earworms are common in people with no anxiety at all. That said, elevated arousal makes any intrusive mental content harder to dislodge, so a stressful period can make an ordinary earworm feel much more persistent.
Why instrumental music and not songs with lyrics?
Nobody is certain. The researchers themselves flagged the result as counterintuitive. One possibility is that lyrics give the brain a complete, resolvable structure, while a wordless melody leaves more to fill in. This has not been confirmed.
Can I stop it by playing different music?
Sometimes, though you risk simply installing a new earworm. Undemanding non-musical distraction is generally the safer bet at bedtime.
From Nuvirox
Why we formulated Sleep+ Restore

Quietening the mind at bedtime is the hard part of most sleep routines. Sleep+ Restore is our evening formula, combining melatonin with a blend of botanicals and amino acids traditionally used as part of winding down.
- 10 mg melatonin — melatonin is the most-studied sleep-timing compound in the supplement aisle; this is a high dose relative to the amounts used in most published trials, which is worth knowing before you start.
- 905 mg Sleep Formula blend — L-tryptophan, lycium, chamomile, lemon balm, passionflower, L-taurine, hops, St. John’s Wort, GABA, Chinese skullcap, L-theanine, ashwagandha, inositol and 5-HTP: botanicals and amino acids traditionally used in evening formulas.
- Vitamin B6, calcium and magnesium — cofactors included to round out the formula.
- 60-day money-back guarantee — long enough to actually evaluate it over a run of ordinary nights rather than one hopeful week.
The bottom line
A song stuck in your head at bedtime is your brain rehearsing recently encoded material in a room with nothing to compete against it. That is ordinary, but it is not harmless: in the one laboratory experiment to test it properly, night-time earworms came with measurably worse sleep, and the instrumental versions people assume are gentler caused more of them than the originals. The evidence base is one research group and fifty participants, so hold it loosely. The practical implications — finish the tune, displace rather than suppress, and move music earlier in the evening — cost nothing and are worth trying.
References
- Scullin MK, Gao C, Fillmore P. Bedtime music, involuntary musical imagery, and sleep. Psychological Science. 2021;32(7):985–997. DOI: 10.1177/0956797621989724.
- Jespersen KV, Pando-Naude V, Koenig J, Jennum P, Vuust P. Listening to music for insomnia in adults. Cochrane Database of Systematic Reviews. 2022;8(8):CD010459. PMID: 36000763.
- Arnulf I, Uguccioni G, Gay F, et al. What does the sleeping brain say? Syntax and semantics of sleep talking in healthy subjects and in parasomnia patients. Sleep. 2017;40(11):zsx159. DOI: 10.1093/sleep/zsx159.
- Marks E, Hallsworth C, Vogt F, Klein H, McKenna L. Cognitive behavioural therapy for insomnia (CBTi) as a treatment for tinnitus-related insomnia: a randomised controlled trial. Cognitive Behaviour Therapy. 2022. DOI: 10.1080/16506073.2022.2084155.
*These statements have not been evaluated by the Food and Drug Administration. This product is not intended to diagnose, treat, cure, or prevent any disease. This article is for informational purposes only and is not a substitute for professional medical advice.