Why do your legs wait until the lamp is off to start asking for something? That is the question people type at midnight, usually after an hour of shifting, kicking one foot out from under the covers, and getting up for a lap of the hallway that helps right up until they lie down again. If you are looking for how to sleep when your legs won't settle, the useful answer comes in two parts, and the first part is the one most pages skip: this pattern has a name, it is a recognized medical condition, and it is worth an appointment. The second part is what to do with tonight, which is smaller and less satisfying, but it is what you have until that appointment happens.

What the urge to move actually is
People describe it in wildly different words, and almost never as pain. A crawling or fizzing feeling deep inside the calves. An ache with no sore spot. A sense that the leg is being wound up and needs to be discharged. Something that is not quite an itch, in a place you cannot scratch.
The shape of it is more consistent than the description. It tends to arrive in the evening and get worse the longer you stay still, which is why the couch, the cinema, a long flight, and bed are where you notice it. Moving eases it — and that is the trap, because the relief usually lasts about as long as the movement does. So you walk it off, feel fine, get back into bed pleased with yourself, and it starts again. That cycle is exhausting in a specific way, because the tiredness is real but your body will not accept the stillness that sleep requires.
This may be restless legs syndrome, and that is worth saying plainly
What is described above is the classic picture of restless legs syndrome. It is not a quirk, a habit, or a failure of willpower. It is a recognized neurological condition that doctors know well, it is common, and there are real treatments for it — which is exactly why this page is not going to offer you any.
That is a deliberate limit, not a dodge. The sensible next step for restless legs is a real appointment, because a doctor can look at things a web page cannot: what else is going on with your health, what medications you already take (some can stir this up), and what a simple set of tests shows. The right approach genuinely depends on those answers, and self-treating around them — with supplements, with anything over the counter, with a friend's prescription — can waste months or make things worse. The NHS advises seeing a doctor about restless legs when it is disrupting your sleep, and disrupting your sleep is precisely why you are reading this at midnight.
Make it an easy appointment to prepare for. Before you go, note down roughly when the feeling starts in the evening, what it does when you move, how many nights a week it happens, and how long it has been going on. If someone shares your bed and has mentioned that your legs jerk or kick once you are asleep, tell the doctor that too — it is relevant, and you would never know it on your own. Those few sentences give a clinician most of what they need, and this is not an obscure complaint to bring in. They will have heard it many times this month.
How to sleep when your legs won't settle: getting through tonight
None of what follows treats anything, and we want to be exact about that, because the list below — walking it off, a slow calf stretch, a warm shower, a cooler room — is the same list you will find on pages that present it as a remedy. It is not one. These are comfort measures for a night you have to spend somehow, and you should judge each one only by whether it made the next hour easier. If something here does seem to help, that is worth writing down and telling the doctor at the appointment, because it is a piece of information about your particular case. It is not a reason to cancel the appointment, and it is not a substitute for whatever the appointment turns up.
Get up instead of fighting. If the urge has taken over, lying there and refusing to move is a losing arrangement — you get the discomfort and the frustration at once. Get up, walk around the flat, do a slow calf stretch at the side of the bed, and go back when you feel calmer. Do it in low light and without your phone, so you are only leaving the bed, not restarting your evening. Expect to do it more than once. That is a normal night with this, not a sign the night is ruined.
Try warmth or cool, and keep it simple. Plenty of people reach for a warm shower before bed, or the opposite — bare feet out of the covers, a cooler room, cool sheets. There is no rule about which one is yours. Try one for a few nights, notice honestly whether it helped, and drop it if it did not. What you are looking for is comfort, not a cure, and a complicated bedtime ritual built out of guesses tends to add pressure rather than remove it.
Give your legs room. Tucked-in sheets and a heavy duvet clamped over your feet make the covers one more thing pinning you down. Loosen the bottom of the bed. If you share it, separate blankets solve a surprising amount, and so does saying out loud, before lights out, that you will probably be up a couple of times tonight and it is nothing to worry about. Getting in and out of bed is much easier when nobody is being woken into a mystery.
Do not spend the evening completely still. Long stretches of sitting late in the day are when this often builds. If your evening is a three-hour block on the couch, breaking it up with a short walk or standing for part of it is worth trying. On the other end, a hard workout late at night can leave you wired for entirely separate reasons — that problem, and the cool-down that fixes it, is covered in how to sleep after a late workout.
Let your doctor handle the substances question. Caffeine, alcohol, and the medicines already in your cabinet all come up in this conversation, and they interact with each other in ways worth getting right the first time. Take the list to the appointment rather than running experiments on yourself at 2am.
Turn the clock away. Doing arithmetic about how much sleep is left adds a second problem to a night that already has one. If you are lying there wide awake and bone-tired, the wider version of that mismatch is in why can't I sleep even when tired.
Where sound fits, and where it does not
Be clear about this: a sound cannot touch a signal coming from inside your own leg. Anyone who tells you otherwise is selling something. What a steady sound can do is much smaller and quite specific to this problem — it keeps the bedroom the same on your fourth visit as it was on your first. Silence announces itself when you come back through the door: the house is quiet, everyone else is asleep, and you are up again. A room that already has a sound running in it does not deliver that line (the general mechanism, if you want it, is here).
For a night of getting up and lying back down, that turns out to be worth having. We would point you at Forest, River and Night Nature for it, because moving water and open night air is the rare sort of sound that suits being upright as well as lying down — you can walk out of the room with it playing and it is still ordinary background when you walk back in. Nothing in it is going anywhere. Each track is edited to end where the next one begins, so leave the playlist on repeat and turn any sleep timer off, and it will still be running on your third trip back from the hallway as well as your first. Quiet enough that you would not notice it if you were asleep. Our checklist for a sound that behaves this way is in what makes a rain sound work. If a different family of sound suits you better, the rest are in our guides.
The part that actually changes the nights
Everything above is a way of getting from here to morning without stacking frustration on top of discomfort. None of it moves the underlying thing, and none of it is meant to. Tomorrow, in daylight, with a clear head and those few notes in your pocket, book the appointment. That is the step this page exists to push you toward, and it is worth more than every comfort measure on it put together.
This article is for general information and isn't medical advice. If sleep problems persist, talk to your doctor.