How Long to Stay in Bed If You Can't Sleep (and What to Do Instead)
How long to stay in bed if you can't sleep: about 20 minutes, or when you notice you're getting frustrated, whichever comes first. Then get up, go somewhere dim, and do something quiet and boring until you feel sleepy again, before returning to bed. Lying awake for long stretches trains your brain to link your bed with being awake, which can turn a few bad nights into ongoing insomnia.
It feels wrong. You're tired, so surely staying in bed and resting is better than getting up? But sleep specialists have recommended the opposite for decades, and it's a core part of cognitive behavioral therapy for insomnia (CBT-I). This guide explains why, exactly what to do when you get up, and how to avoid the mistakes that make it backfire.
Why lying awake makes things worse
Your brain is constantly learning associations. If your bed is mostly a place where you sleep, getting into it becomes a strong cue for sleepiness. But if you regularly lie there awake, worrying about the clock, scrolling or replaying the day, your bed becomes linked with alertness and frustration instead.
That's why many people with insomnia feel sleepy on the couch and then suddenly wide awake the moment they get into bed. The technique of getting up is called stimulus control, and its job is to rebuild the bed-equals-sleep link.
Mayo Clinic describes this as part of CBT for insomnia: if you can't fall asleep within about 20 minutes, get up and don't go back to bed until you're sleepy, while keeping your wake-up time the same. Mayo also notes that CBT is generally the first treatment recommended for long-term insomnia.
Why "20 minutes" and not exactly 20
The 20-minute figure is a guideline, not a stopwatch rule. Checking the clock can make you more anxious, which defeats the purpose. Instead:
- Go by feel. If you notice you're wide awake, restless or irritated, it's time to get up.
- Hide the clock. Turn it away or put your phone outside the room. Estimating is fine.
- Don't get up the instant you're awake. Brief wakings are normal. Give yourself a calm chance to drift back first.
Exactly what to do when you get up
- Go to another room if possible, or at least a different spot like a chair in the corner of the bedroom.
- Keep the light low. Use a dim lamp, not overhead lights. Bright light tells your brain it's daytime.
- Do something calm and a little boring. The activity should be pleasant enough to relax you but not so gripping that you lose track of time.
- Avoid screens if you can. Phones and laptops are stimulating and bright, and it's easy to lose an hour.
- Go back to bed only when you feel sleepy, with heavy eyes, yawning and drooping head, not just tired.
- Repeat if needed. If you're still awake 20 minutes later, get up again. The first few nights may involve several rounds.
Good and bad out-of-bed activities
| Good choices | Poor choices |
|---|---|
| Reading a paper book or magazine (not a thriller) | Scrolling social media or the news |
| Gentle stretching | Intense exercise |
| Listening to quiet music or an audiobook with the screen off | Video games or binge-watching |
| Folding laundry, simple puzzles, coloring | Working on emails or a project |
| Slow breathing or a body scan | Eating a big snack or drinking alcohol |
| Writing down worries and a plan for tomorrow | Doing chores in bright light |
If racing thoughts are what keeps you awake, writing them down can be especially useful. Our guide to stop overthinking before bed has a simple "worry download" method. You can also try one of our breathing exercises for anxiety while sitting up in dim light.
What to do about middle-of-the-night waking
The same approach applies if you wake at 2 or 3 a.m. and can't get back to sleep:
- Stay put for a while and let yourself drift. Don't check the time.
- If you're clearly wide awake or frustrated after roughly 20 minutes, get up and follow the steps above.
- Keep your wake-up time the same no matter how the night went.
Waking briefly during the night is normal; most people wake several times without remembering. The problem is lying awake for long stretches, not the waking itself.
The other half of the rule: a fixed wake time
Getting up at night only works if you also wake at the same time every morning, even after a bad night. The NHS advice on insomnia includes waking up and getting out of bed at the same time every day and not sleeping in after a poor night. That consistency builds sleep pressure for the next night, so you fall asleep more easily.
It's tempting to sleep in or nap after a rough night. Try not to. A short nap of 20 minutes or less, early in the afternoon, is the most you should allow while you're working on this.
What to expect in the first two weeks
| Days | What often happens |
|---|---|
| 1–3 | You may get up several times a night and feel more tired than usual |
| 4–7 | Fewer trips out of bed; you start falling asleep faster when you return |
| 8–14 | Bed starts to feel like a sleep cue again; total sleep often improves |
The first week is the hardest. Stick with it even on nights when you have to get up three or four times; those are the nights doing the most retraining. Feeling more tired in the short term is a sign the process is building sleep pressure. Avoid driving or operating machinery if you feel drowsy.
Pair it with other good habits
The rule works best alongside a solid routine:
- Only go to bed when sleepy, not just because it's a certain time.
- Use the bed only for sleep and sex, not for working, eating or scrolling.
- Cut caffeine earlier; see the best time to stop caffeine for sleep.
- Build a wind-down hour using our sleep hygiene checklist.
When to get help
If you've been struggling to fall or stay asleep at least three nights a week for three months or more, or it's affecting your days, talk to a doctor. Insomnia is common and treatable, and CBT-I with a trained clinician or a structured digital program is highly effective. The NHLBI's insomnia page is a helpful overview. Also seek advice if you snore loudly, gasp at night or feel very sleepy in the day, which can point to sleep apnea.
More guides live on the Humantra Sleep hub.
Frequently asked questions
How long should I lie in bed if I can't sleep?
About 20 minutes, or sooner if you feel frustrated or wide awake. Then get up, do something calm in dim light, and return when you feel sleepy.
Why should I get out of bed when I can't sleep?
Lying awake for long periods teaches your brain to associate your bed with being awake. Getting up helps rebuild the link between bed and sleep, a technique called stimulus control.
What should I do when I get out of bed at night?
Choose something quiet and mildly boring in low light, such as reading a paper book, gentle stretching or slow breathing. Avoid screens, work and bright lights.
Should I check the clock to time 20 minutes?
No. Clock-watching increases anxiety. Estimate instead, and get up when you notice you're restless or frustrated.
Is it okay to stay in bed and rest if I can't sleep?
Occasionally resting quietly is fine, but doing it regularly can worsen insomnia. If you're often awake in bed, getting up is usually more helpful.
How long does stimulus control take to work?
Many people notice improvement within one to two weeks of doing it consistently, especially when combined with a fixed wake time.
Medical disclaimer: This article is for general educational purposes only and is not medical advice, diagnosis, or treatment. Persistent trouble sleeping, loud snoring, gasping at night, or heavy daytime sleepiness can signal a sleep disorder; talk with a qualified healthcare professional, especially if you have a health condition, take medication, or are pregnant. Never drive or operate machinery while drowsy.