A song stuck in your head at night is often an earworm: a short piece of music that repeats in your mind without you choosing it. Turning off the speaker does not always stop the mental replay. If it is keeping you awake, try ending the music earlier and giving your attention something quiet and non-musical to do. There is no reliable instant off-switch.

Perhaps it is the chorus you heard while cooking, or a few notes from a video. You are ready for bed; that small section appears to have other plans. You do not need to work out the whole song before you can rest.

Why does the same bit keep repeating?

Researchers call this involuntary musical imagery. You recognise the tune as something happening in your mind, even though no music is playing nearby. An earworm can contain words, but a melody without lyrics can repeat too.

Recent listening and repetition can make a tune more likely to come back. A small experiment on music exposure found that hearing unfamiliar songs more often was linked to more later musical imagery. That study was about remembered music, not a treatment for sleep difficulties.

This helps explain why another listen is not automatically the answer. Sometimes it may simply give the tune more rehearsal. Nor does having a familiar chorus in mind, by itself, tell you that you have a sleep or mental health condition.

Can an earworm actually affect sleep?

There is some evidence, but it needs a careful reading. A 2021 study by Scullin and colleagues found an association between nighttime earworms and poorer reported sleep in a survey of 199 adults. Its laboratory experiment analysed 50 young adults who heard either lyrical or instrumental versions of three familiar pop songs before bed. The instrumental group had worse sleep on some measured outcomes.

That was a small, specific experiment without a silence comparison. It does not show that all instrumental music harms sleep, or that everyone should stop listening at bedtime. It does challenge the idea that removing lyrics always prevents a song from following you to bed.

If you enjoy music and sleep comfortably afterward, an occasional earworm is not a reason to redesign your evenings. If the same problem keeps happening, your own listening pattern is worth changing. Our broader look at music and sleep covers a different question: when listening itself may feel helpful.

What can you try tonight?

Choose one small adjustment rather than turning bedtime into a series of tests.

Stop adding more of the tune

Pause the track or the stream of short videos. If you repeatedly notice musical loops after late listening, move that listening to earlier in the evening. There is no established number of music-free minutes that works for everyone. The Baylor researchers suggest changing listening habits; this is not a guaranteed way to remove an earworm.

You do not have to abandon music you love. You are making a little room between the last replay and bed.

Give your attention another place to go

Try a few pages of an undemanding paper book, or another quiet activity you already find easy. Pick something you can put down without needing to finish a chapter or solve a problem. Reading before bed is one option, not another requirement to get right.

Cleveland Clinic's guidance on earworms includes shifting attention. That does not mean testing every few seconds to see whether the song has vanished. If it comes back, you can gently go back to what you were doing. The aim is to make the evening less frustrating, not to prove you can control every thought.

If you are wide awake, take a break from bed

When you are lying there increasingly frustrated, it can help to get up for a quiet activity and go back when you feel sleepy. NIH's sleep guidance recommends this approach to prolonged wakefulness in bed. It is general sleep advice, not an earworm-specific cure. You need not keep checking the clock to put it into practice.

For more detail, see why sleep experts suggest getting out of bed when you cannot sleep.

When is it worth asking for help?

If sleep difficulties keep happening, changes to your habits are not helping, or tiredness is making everyday life hard to manage, speak with a healthcare professional. The NHS recommends getting help in these situations. You do not need to keep adding self-help techniques indefinitely.

Also ask for advice if the music feels as though it is genuinely playing in the room when there is no source, rather than a tune you recognise in your thoughts. Tinnitus UK explains that hearing music without an external source can be a different experience. This article cannot tell you which experience you are having.

For an ordinary bedtime earworm, tonight's plan can stay simple: stop replaying the track, choose something quiet, and let resting matter more than making your mind completely silent.

This article is general information, not medical advice.

Latest Stories

View all

An apartment bedroom with a bed beside a balcony overlooking nearby homes.

How to Check Apartment Noise Before You Sign

Check the bedroom at the pillow spot, separate street noise from building noise, and use a quick scorecard to compare apartments before you sign.

Read moreabout How to Check Apartment Noise Before You Sign

How to Sleep at Someone Else's House Over the Holidays

How to Sleep at Someone Else's House Over the Holidays

Yes, but expect the first night to be the hardest. In a new place, one half of your brain stays partly on watch, so unfamiliar sounds wake you more easily and deep sleep runs lighter. Bring your own pillow and...

Read moreabout How to Sleep at Someone Else's House Over the Holidays

A digital clock with bright white numerals on a desk in a room lit red.

Bedside Alarm Clock Too Bright? A Two-Pillow Check

A readable bedside clock does not have to light up both pillows. Test where its glow lands before you dim it, move it, or buy a new one.

Read moreabout Bedside Alarm Clock Too Bright? A Two-Pillow Check