Shift work
Night Shift Sleep Calculator: When to Sleep Before and After Your Shift
Enter your night shift times and commute to get a daytime sleep window, an optional pre-work nap, a caffeine cut-off, and a plan for night one and days off.
Enter your shift times and commute, and the calculator builds a sleep plan around them: when to turn the lights out after work, when to wake, an optional nap before you leave, and the time of your last coffee. For a 7 PM to 7 AM shift with a 30-minute drive, that works out to sleep from about 8:00 AM to 3:30 PM and no caffeine after midnight. It also sketches your first night on and your days off, so you are not starting from scratch every week.
How the night shift calculator works
Everything hangs on one piece of advice: sleep as soon as you get home. NIOSH tells night workers to go straight to bed after the shift, leave the errands for later and sleep as long as they can, because the more sleep you get before 2 p.m., the better rested you will be [1]. From there the calculator does a handful of sums:
- Lights out = shift end + commute + 30 minutes to wash up and get into a dark room.
- Wake-up = lights out + the sleep you need (7.5 hours unless you change it).
- Split option = 90 minutes less in the main block, plus a 90-minute nap that ends an hour before you leave.
- Caffeine cut-off = lights out minus 8 hours (or 6, if you choose).
- Light at work = bright until the midpoint of the shift, dimmer after it.
Not every number here comes from a guideline, and you should know which ones don't. The 30 minutes to get to bed, the 90-minute nap, the hour of wake-up time after it, the midpoint split for light and the exact days-off times further down are SleepGuru's own simplifications, chosen to turn general advice into clock times. The 7.5-hour default is our choice too, sitting just above the 7 or more hours adults need on a regular basis [5]. If you know you run better on 8 or 9, pick that. The calculator also warns you when a long shift and commute leave too little room to fit it all in.
Worked example: a 7 PM to 7 AM shift
Here is what the calculator produces for a 12-hour night shift, a 30-minute commute each way, 7.5 hours of sleep and a usual day-schedule wake-up of 7:00 AM:
| Part of the plan | One block | Block plus nap |
|---|---|---|
| Home, lights out | 7:30 AM, 8:00 AM | 7:30 AM, 8:00 AM |
| Main sleep | 8:00 AM to 3:30 PM | 8:00 AM to 2:00 PM |
| Nap before work | None | 4:00 PM to 5:30 PM |
| Leave for work | 6:30 PM | 6:30 PM |
| Last caffeine (8-hour rule) | 12:00 AM | 12:00 AM |
| Bright light / dimmer light | 7 PM to 1 AM / after 1 AM | 7 PM to 1 AM / after 1 AM |
| First night on | Nap 4:00 to 5:30 PM: awake 13 h 30 min by 7 AM instead of 24 h | |
| Days off | Bed about 3:30 AM, up about 12:30 PM (4 h 30 min overlap with work-day sleep) | |
Pick the 6-hour caffeine option and the cut-off moves to 2:00 AM. Change the shift to 10 PM to 6 AM and lights out moves to 7:00 AM, with the cut-off at 11:00 PM, barely an hour into the shift.
One long sleep or a nap before work?
Both work. The better one is whichever you can actually protect. A single block is simpler and keeps your sleep in one stretch of darkness. The split suits people who wake in the early afternoon no matter what, or who want time with family before work. NIOSH encourages a nap before going back to work whenever you can fit one in [1]. Whether, when and how long to nap before nights has its own guide: should you sleep before a night shift.
Caffeine and light during the shift
Coffee at 4 AM feels like a lifeline. At 8 AM, when you are trying to sleep, a good part of it is still in your system: NIOSH puts caffeine's half-life at 5 to 6 hours, and much longer in some people [4]. So NIOSH suggests taking it early in the shift and stopping several hours before the end [4]. The calculator turns "several hours" into a clock time by counting back 8 hours from lights out, the Sleep Foundation's general cut-off before bed [6]. Applying that rule to daytime sleep is our choice, not a shift-work guideline.
One thing the cut-off must never do is put you on the road half asleep. It is there to protect your daytime sleep, and staying alert at work and on the drive home matters more. If cutting caffeine early leaves you dangerously drowsy, treat that as a sign to get a ride home, not to push through. To see how much of your own intake would still be around at bedtime, the caffeine calculator models it drink by drink.
Light follows the same logic. NIOSH suggests spending as much of the first half of a night shift as you can in a brightly lit area, then cutting back on bright light in the second half so sleep comes more easily at home, unless you are very sleepy, when bright light can help keep you alert [3]. Feeling your eyelids droop at 5 AM? Safety first: use the light.
Your first night and your days off
The first night is the hardest, because you arrive at work having been up since morning. Picture it: you wake at 7:00 AM, work 7 PM to 7 AM, and by the drive home you have been awake for a full day. NIOSH warns that staying up all day before the first of a block of nights leaves you awake for too many hours [2]. The calculator slots a 90-minute nap into the late afternoon, which cuts that stretch from 24 hours to about 13 and a half.
Days off are where most night workers lose ground. Flip straight back to days, then onto nights again, and your body clock spends the whole week catching up. NIOSH describes a compromise: on days off, stay up until 3 or 4 a.m. and sleep until noon or 1 p.m., so some hours of sleep fall at the same time every day [2]. The calculator uses the middle of those ranges, 3:30 AM to 12:30 PM, and shows how many hours overlap with your work-day sleep. For a full move back to days at the end of a run, see switching from night shift to day shift.
The drive home comes first
The most dangerous part of a night shift is often the trip home. If you feel drowsy, don't drive. AASM's Sleep Education site suggests arranging for someone to pick you up, or taking a bus or cab, because drowsy driving puts your life and other people's at risk [7]. The same page notes that sunglasses on the way home can help you fall asleep faster once you get there [7]. There's a catch: sunglasses also block the alerting effect of morning light, so NIOSH advises wearing them after a night shift only if someone else is driving [3]. Once you are home, a properly dark, quiet bedroom matters, because daylight triggers waking [1]. Our guide to sleeping during the day after a night shift covers how to set one up.
Limits and assumptions
The plan assumes a run of the same night shift that ends in the morning. Rotating schedules and early-morning starts need a different approach, and the calculator will refuse shifts that end outside 2:00 AM to noon. It also assumes your bedroom is truly dark and quiet, since daytime sleep falls apart without that [1], and that you clear caffeine at a typical rate. Caffeine's half-life ranges from about 2 to 12 hours, so for slow clearers even an 8-hour gap may be too short [6]. None of the clock times are medical advice. They are a starting point to adjust after a week or two of real shifts.
Many people struggle for a while after starting nights. If after several weeks you still have trouble falling or staying asleep, or you feel tired even after 7 to 8 hours of sleep, you may have shift work disorder, and a sleep specialist can help [7]. See a doctor sooner if you nod off at work or behind the wheel.
Frequently asked questions
What time should I go to sleep after a 7 PM to 7 AM shift?
As soon as you can after you get home. With a 30-minute commute, that puts lights out around 8:00 AM and, for 7.5 hours of sleep, an alarm around 3:30 PM. NIOSH tells night workers to go straight to bed when they arrive home and not to spend the early morning on chores, adding that the more sleep you get before 2 p.m., the better rested you will be [1].
How much sleep do night shift workers need?
The same as anyone else. Adults should sleep 7 or more hours on a regular basis [5], and working nights doesn't shrink that number. What changes is how you collect it: one long block after the shift, or a slightly shorter block plus a nap before work. Both count toward the same daily total.
When should I stop drinking coffee on a night shift?
Front-load it. NIOSH suggests night workers who rely on caffeine take it near the start of the shift and stop several hours before the end, since its half-life is 5 to 6 hours and much longer in some people [4]. The Sleep Foundation's general cut-off is at least 8 hours before bed [6]. For a 7 PM to 7 AM shift with 8:00 AM lights out, that means a last cup around midnight. If that leaves you too drowsy to drive home safely, don't drive.
Should I nap before my first night shift?
Usually, yes. Wake at your normal time and work through the night, and you could be awake 24 hours by the end of the shift. AASM's Sleep Education site says even a 20 to 30 minute nap before a night shift can improve your alertness on the job [7]. Our guide on sleeping before a night shift covers nap length and timing.
Sources
- National Institute for Occupational Safety and Health (CDC). Module 9. Coping with the Night and Evening Shifts, Sleep
- National Institute for Occupational Safety and Health (CDC). Module 9. Coping with the Night and Evening Shifts, Sleep (Continued)
- National Institute for Occupational Safety and Health (CDC). Module 9. Coping with the Night and Evening Shifts, Light
- National Institute for Occupational Safety and Health (CDC). Module 6. Improving Your Sleep and Alertness, Prepare for Sleep
- Watson NF et al., Journal of Clinical Sleep Medicine. Recommended Amount of Sleep for a Healthy Adult: A Joint Consensus Statement of the American Academy of Sleep Medicine and Sleep Research Society (2015)
- Sleep Foundation. Caffeine and Sleep Problems
- American Academy of Sleep Medicine (Sleep Education). Shift Work
This page is general information, not medical advice. Sleep needs vary; if you have persistent insomnia, loud snoring, pauses in breathing or daytime sleepiness that affects your safety, see a doctor.