Sleep science · evidence-based · interactive protocol

Sleep Optimization

How sleep actually works, plus an interactive improvement protocol with saved progress — light, caffeine & alcohol timing, bedroom temperature, naps, supplements, CBT-I, and the red flags that mean "see a doctor."

Sleep protocol
0%
0 / 0
How to use this page. The Sleep Improvement Protocol is an interactive checklist — tick each habit you've adopted and your progress is saved in your browser (localStorage), so you can close the tab and resume. Everything else is reference. Start with the two highest-leverage levers: a fixed wake time and morning light.
Not medical advice. This is an educational reference. Persistent insomnia, loud snoring with gasping/choking, or daytime sleep attacks warrant a clinician — see Red flags. Don't start, stop, or combine supplements or sleep medications without professional guidance, especially if pregnant or on other drugs.

Quick Reference — the highest-leverage numbers

LeverTargetWhy / note
Adult sleep need7–9 h (≥7 h on a regular basis)AASM/SRS consensus, ages 18–60. Teens 8–10 h; kids 6–12: 9–12 h.
RegularitySame wake time ±30 min, 7 days/wkSleep consistency predicted mortality more strongly than duration (SLEEP, 2024).
Morning light10–30 min outdoor within ~1 h of wakingOutdoor daylight is 10,000–100,000 lux vs ~500 indoors — it anchors your clock.
Caffeine cutoff≥8–10 h before bed (often ≤2 pm)Half-life ~5 h (range 1.5–9.5). 400 mg even 6 h pre-bed cut sleep ~41 min.
AlcoholNone within 3–4 h of bedSedates you fast, then fragments the night and suppresses early REM.
Bedroom temp~18 °C / 65 °F (range 16–20 °C)Core-temp drop is a sleep trigger; cool, dark, quiet.
Screen / bright lightDim & warm 2–3 h before bedBrightness & engagement matter more than "blue light" alone.
Melatonin (if used)0.5–1 mg, 2–3 h before target sleepA timing signal, not a sleeping pill. Higher doses aren't better.
Nap10–20 min, early–mid afternoonAvoid >30 min or naps after ~3 pm (steals sleep pressure).
Sleep cycle~90 min, 4–6 per nightDeep sleep front-loaded; REM back-loaded (so a short night cuts REM most).
Chronic insomnia (1st-line)CBT-I, not sleeping pillsACP & AASM: more durable than medication, fewer harms.
Wind-down30–60 min screen-light, low-stimulationConsistency trains the brain that bed = sleep.

Fundamentals
How sleep works — the mental model

The two-process model: sleep pressure × the clock

When and how well you sleep is governed by two systems running in parallel (Borbély's model):

  • Process S — sleep pressure (homeostatic). A molecule called adenosine builds up in the brain the longer you're awake, creating drowsiness. Sleep clears it. Caffeine works by blocking adenosine receptors — it masks pressure, it doesn't remove it, so the "crash" comes when it wears off.
  • Process C — the circadian rhythm (the clock). A ~24-hour timer in the brain's suprachiasmatic nucleus (SCN) sets your alertness rhythm, core body temperature, and melatonin release. Its master input ("zeitgeber") is light.

Good sleep = high sleep pressure (enough hours awake, no late caffeine/naps) meeting a well-timed clock (consistent schedule, morning light, dark evenings). Fight either one — nap at 6 pm, or stare at a bright phone at midnight — and you sleep worse even when tired.

Sleep stages & architecture (N1, N2, N3, REM)

Sleep isn't uniform. You cycle through stages, each doing different work:

Stage~% of nightWhat it isWhat it's for
N1 (light)~5%Drift-off; easily woken; the "falling" jerk.Transition only.
N2 (light)~45–55%Sleep spindles & K-complexes; body cools, HR drops.Motor-skill memory; bulk of the night.
N3 (deep / slow-wave)~13–23%Big slow delta waves; very hard to wake; grogginess if woken.Physical recovery, immune function, glymphatic "clean-out," declarative memory.
REM~20–25%Vivid dreams; brain active, body paralyzed (atonia); eyes dart.Emotional processing, creativity, memory integration.

Rough proportions for a healthy adult night. Newborns spend ~50% in REM; REM share falls with age, and N3 deep sleep declines markedly after ~age 60.

Cycles & the hypnogram: why a short night robs REM

You move through ~90-minute cycles, 4–6 times a night — but the mix shifts across the night:

  • First third of the night is rich in deep N3 sleep (physical restoration). This is why an early bedtime that you keep matters, and why deep sleep is largely "protected."
  • Last third is rich in REM, in progressively longer bouts toward morning.
Practical consequence: cutting sleep from 8 h to 6 h doesn't shave 25% off each stage evenly — it disproportionately deletes the morning REM you never got to. Chronically short nights = an REM deficit (mood, learning, emotional regulation). "I'll sleep 5 hours and be fine" almost always means "I'll skip REM."
Circadian rhythm: light, melatonin, temperature & cortisol

Four signals choreograph the 24-hour cycle. Align them and sleep gets easy; scramble them (shift work, jet lag, midnight scrolling) and it falls apart.

  • Light — the master clock-setter. Bright light in the morning advances the clock (earlier sleep); bright light at night delays it (later sleep). Special melanopsin cells in the retina sense this independent of vision.
  • Melatonin — the "it's dark, prepare for sleep" hormone. Onset (DLMO) is ~2–3 h before natural sleep; light at night suppresses it. Supplemental melatonin works mainly by shifting timing, not by sedating.
  • Core body temperature — peaks early evening, then falls ~0.5–1 °C to enable sleep, bottoming ~2 h before wake. A warm bath/shower 1–2 h before bed paradoxically helps by dumping heat afterward. A cool room helps the drop.
  • Cortisol — the alerting hormone; lowest around midnight, surging before wake (the cortisol awakening response). Evening stress/late screens keep it elevated and delay sleep.

Fundamentals
How much sleep you actually need

AgeRecommended / 24 h
Newborn (0–3 mo)14–17 h
Infant (4–12 mo)12–16 h (incl. naps)
Toddler (1–2 yr)11–14 h
Preschool (3–5 yr)10–13 h
School age (6–12 yr)9–12 h
Teen (13–18 yr)8–10 h
Adult (18–60)7–9 h (≥7)
Older adult (65+)7–8 h

AASM/SRS & AAP/AASM pediatric consensus. Individual need varies; ranges, not targets.

Regularity rivals duration. A 2024 SLEEP analysis of ~60,000 UK Biobank participants found day-to-day sleep regularity predicted all-cause mortality more strongly than total sleep duration — the most regular sleepers had ~20–48% lower mortality risk than the most irregular. Pick a wake time and defend it, including weekends.
You're a bad judge of your own need. True "short sleepers" (genuinely fine on <6 h, often a rare DEC2/ADRB1 gene) are <1% of people. Most "I only need 5 hours" folks are simply adapted to feeling tired. Test it: on vacation with no alarm, how long do you sleep by the end of week one?
Sleep debt is real but only partly repayable. One or two nights of extra weekend sleep recovers some alertness but not all cognitive deficits, and "social jet lag" (sleeping 2+ h later on weekends) re-delays your clock — making Monday brutal. Consistency beats catch-up.

Do this
The Sleep Improvement Protocol (tick what you've adopted)

Ordered roughly by leverage. You don't need all of them — fix the top few first. Progress saves automatically on this device.

Anchor a fixed wake time — 7 days a week

The single most powerful lever. Your wake time, not your bedtime, sets the circadian clock. Pick one you can keep on weekends (±30 min) and let bedtime drift to when you're actually sleepy.

Sleeping in on Saturday feels great and silently delays your clock — "social jet lag." If you're exhausted, go to bed earlier; don't move your wake time.
Get bright light early, dim light late

Get 10–30 minutes of outdoor light within an hour of waking (even overcast daylight is 10–100× brighter than indoor lighting). In the evening, dim overheads, switch to warm/low lamps, and avoid bright screens 2–3 h before bed.

No morning sun (winter, night shift)? A 10,000-lux light therapy box for 20–30 min at a fixed time is the evidence-based substitute. Sunglasses defeat the purpose — get light on the eyes, not the skin.
Cut caffeine 8–10 hours before bed

With a ~5 h half-life, a 2 pm coffee still has a quarter of its caffeine working at 2 am. For an 11 pm bedtime, aim for last caffeine by ~1–3 pm; earlier if you're a slow metabolizer (sensitive to coffee, or carry slow CYP1A2).

Don't front-load it either: delaying your first coffee 60–90 min after waking lets the morning cortisol/adenosine clear-out happen naturally and may reduce the afternoon crash.
No alcohol within 3–4 hours of bed

A nightcap is a trap: alcohol is sedating up front (you fall asleep fast) but as it metabolizes it fragments the second half of the night, suppresses early REM, worsens snoring/apnea, and triggers 3 am wake-ups. The "I slept but feel unrested" night is usually this.

Make the room cool, dark & quiet

Target ~18 °C / 65 °F. Block light with blackout curtains or a sleep mask (even dim light suppresses melatonin and reduces deep sleep). Mask noise with earplugs or a fan/white noise.

Run hot? A warm shower 60–90 min before bed, breathable bedding, or a cooling mattress pad help dump core heat. Cold feet keep some people awake — socks can speed sleep onset by aiding heat loss at the extremities.
Keep a 30–60 min wind-down routine

A consistent low-stimulation buffer tells the brain sleep is coming: dim lights, shower, read a paper book, stretch, journal, or do a relaxation/breathing exercise. Same sequence nightly = a conditioned cue.

a simple, copyable wind-down (adapt the times)
T-90 min : last food/alcohol; dim the lights; screens to night mode/low
T-60 min : warm shower or bath; set out tomorrow's clothes (offload worries)
T-45 min : phone on charger OUTSIDE the bedroom; analog alarm
T-30 min : read fiction / stretch / 10 slow breaths (4s in, 6s out)
T-0      : lights out at a consistent time; room cool & dark
Use the bed only for sleep (and sex)

This is "stimulus control," the most evidence-backed piece of CBT-I. No working, scrolling, or worrying in bed — you want the brain to associate the bed with sleep, not with wakefulness.

The 20-minute rule: if you can't sleep after ~20 minutes (don't clock-watch — estimate), get up, go to another dim room, do something boring, and return only when sleepy. Lying in bed frustrated trains insomnia.
Nap correctly — or not at all

If you nap: keep it 10–20 minutes, before ~3 pm. That refreshes alertness without entering deep sleep (which causes grogginess) and without stealing the sleep pressure you need at night. If you have insomnia, skip naps entirely — you need maximum sleep pressure at bedtime. See the nap guide.

Exercise — most days, not right before bed

Regular exercise deepens sleep and shortens the time to fall asleep; it's one of the few interventions that reliably increases slow-wave sleep. Morning/afternoon is ideal. Vigorous training in the last ~1–2 hours before bed raises core temp and adrenaline and delays sleep for some people — finish earlier, or test light evening movement (a walk, easy yoga) which is fine.

Stop big meals ~3 hours before bed

Large or fatty/spicy meals close to bedtime cause reflux and raise core temp, fragmenting sleep. Don't go to bed starving either — a small carb/protein snack (e.g. yogurt, banana, a few nuts) can help if hunger wakes you. Cap evening fluids to limit 3 am bathroom trips.

Offload a racing mind before bed

If thoughts spin at lights-out, do a "brain dump" earlier in the evening: write tomorrow's to-dos and worries on paper so the brain stops rehearsing them. In bed, use a non-striving technique — slow exhale-biased breathing, a body scan, or "cognitive shuffling" (picture random unrelated objects). The goal is to stop trying to sleep; effort backfires.

Give changes 2–4 weeks & track

Circadian habits take weeks to consolidate — don't judge a change after one bad night. Keep a simple sleep diary (or use a tracker as a trend tool, not a verdict).

paste-ready sleep diary (one row per day)
Date | In bed | Lights out | Est. time to sleep | # wake-ups | Out of bed | Caffeine (last) | Alcohol | Exercise | Naps | Morning feel (1-5)
2026-06-28 | 22:45 | 23:00 | 15m | 1 | 06:45 | 13:30 | none | AM run | none | 4

Working knowledge
Caffeine & alcohol — the dose/timing detail

A 2023 Sleep Medicine Reviews meta-analysis modeled how long before bed to stop, by dose. Earlier is safer if you're caffeine-sensitive:

Caffeine source (approx.)DoseStop at least … before bed
Espresso shot / small coffee~100 mg~4 hours
Standard mug of coffee~107 mg~9 hours
Large coffee / pre-workout~217 mg~13 hours
Energy drink (varies widely)~80–300 mgread the label; treat like the column above
Reference doses: brewed coffee ~95 mg/8 oz · espresso ~63 mg/shot · black tea ~47 mg · green tea ~28 mg · cola ~34 mg/12 oz · dark chocolate ~12 mg/oz. FDA considers up to ~400 mg/day safe for most healthy adults — but that's a daily ceiling, not a bedtime one.
Alcohol math: the liver clears roughly one standard drink per hour. Two drinks finished at 10 pm are still metabolizing at midnight — which is exactly when they trigger lighter, fragmented sleep and early-morning wake-ups. There is no dose of alcohol that improves objective sleep quality.

Working knowledge
Supplements — what the evidence supports

Supplements are a distant second to behavior and timing. Evidence is mostly modest and short-term; quality varies (look for third-party testing: USP, NSF, Informed Sport). Check interactions with a pharmacist, especially with sedatives, antidepressants, or blood thinners.
SupplementTypical doseBest forEvidence & cautions
Melatonin0.5–1 mg (up to ~3 mg), 2–3 h before sleepJet lag, shift work, delayed sleep phase, age 55+Best evidence is for shifting timing, not sedation. Low dose works; higher doses can cause grogginess/vivid dreams. US supplements are unregulated — actual content varies wildly. Prolonged-release is first-line for insomnia in over-55s (per European guidance).
Magnesium glycinate200–400 mg elemental, eveningMild insomnia, restless legs, if deficientMeta-analysis (older adults): ~17 min faster sleep onset vs placebo, but low-quality evidence. Glycinate/bisglycinate is gentle on the gut; oxide is poorly absorbed and laxative.
Glycine3 g before bedSubjective quality, faster onsetSmall RCTs show improved sleep quality and next-day alertness, possibly via a mild core-temp drop. Generally well tolerated.
L-theanine100–200 mgPre-sleep anxiety, "wired" mindPromotes calm without sedation; modest effect. Often paired with magnesium. Pairs well to blunt caffeine jitters earlier in the day.
Apigenin / chamomiletea, or ~50 mg apigeninGentle relaxation, ritualMild; much of the benefit may be the warm-drink wind-down ritual. Chamomile is a ragweed-family allergen for some.
Ashwagandha300–600 mg (KSM-66/standardized)Stress-driven poor sleepSeveral RCTs show improved sleep and lower stress. Avoid in pregnancy, thyroid disorders, or with immunosuppressants; rare liver-injury reports.
Valerian300–600 mg extractPopular but evidence is weak/inconsistent. Can interact with sedatives.
Avoid: diphenhydramine (Benadryl, ZzzQuil, "PM" pills)Last resort onlyTolerance builds in days; anticholinergic side effects, next-day grogginess, and long-term use is associated with higher dementia risk in older adults. Not for routine sleep.

Working knowledge
Naps — dose them like a tool

Nap lengthEffectUse when
10–20 min (power nap)Alertness boost, no deep sleep, no grogginess.Default. Early–mid afternoon dip.
~30 minRisk of waking mid-deep-sleep → groggy ("sleep inertia") for 15–30 min.Generally avoid.
~60 minIncludes deep sleep; aids memory but groggy on waking.If memory consolidation > immediate alertness.
~90 min (full cycle)Complete cycle incl. REM; wake refreshed.Big sleep debt, no night-sleep impact (e.g. weekend).
The "nappuccino": drink a coffee immediately before a 20-min nap — caffeine takes ~20 min to kick in, so you wake as it lands. Hard rule: no naps after ~3 pm, and none at all if you have insomnia — every nap subtracts from nighttime sleep pressure.

Edge cases
Chronotype, jet lag & shift work

Chronotype — are you a lark or an owl?

Chronotype (your genetically-influenced natural timing) is real and partly fixed. Forcing an extreme owl onto a 5 am schedule creates chronic "social jet lag" and underperformance.

  • To shift earlier (owl → earlier): bright light immediately on waking, dark/dim evenings, small early-evening melatonin (0.5 mg ~5–6 h before current sleep onset, under guidance), and move bedtime earlier in 15-min steps.
  • Work with it where you can: schedule demanding work at your personal peak (late morning for most; later for owls). You can nudge a chronotype by an hour or two, not transform it.
Jet lag — pre-adapt and use light strategically

Rule of thumb: the body re-syncs ~1 time zone per day. Eastward travel (need to sleep earlier) is harder than westward.

  • Shift your schedule 1 h/day toward the destination for a few days before flying.
  • On arrival, adopt local meal & sleep times immediately; get morning light when going east, evening light when going west (the wrong light makes it worse).
  • Low-dose melatonin (0.5–3 mg) at destination bedtime for east-bound trips can speed adaptation.
  • Avoid alcohol and big meals in-flight; hydrate; nap only briefly.
Shift work — damage control

Night/rotating shifts fight biology and raise long-term health risks, so the goal is mitigation: keep a consistent sleep schedule even on days off where possible; use bright light during the shift and dark sunglasses on the commute home to avoid morning light resetting you; sleep in a blackout, cool, quiet room; strategic caffeine early in the shift (not the last few hours); a short pre-shift nap. Rotating forward (day→evening→night) is easier than backward.

Gold standard
CBT-I — first-line for chronic insomnia

If insomnia is chronic (3+ nights/week for 3+ months), CBT-I — not sleeping pills — is the recommended first-line treatment (American College of Physicians; American Academy of Sleep Medicine). It's as effective short-term and more durable long-term than medication, without dependence or rebound insomnia. Available via clinicians, and via well-studied apps/digital programs.

Its components (several you've already met in the protocol above):

ComponentWhat it is
Stimulus controlBed = sleep only; out of bed if awake >~20 min; fixed wake time. Re-associates bed with sleep.
Sleep restrictionTemporarily limit time in bed to actual sleep time to build sleep pressure and consolidate sleep, then expand. (Do this with guidance — it's counterintuitive and briefly tiring.)
Cognitive therapyChallenge catastrophizing ("if I don't sleep I'll fail tomorrow"), which fuels the anxiety that prevents sleep.
Relaxation trainingDiaphragmatic breathing, progressive muscle relaxation, body scan — lower pre-sleep arousal.
Sleep hygieneThe environmental/behavioral basics in this guide. Necessary but, alone, the weakest component — it rarely fixes real insomnia by itself.

Working knowledge
Sleep trackers — useful trends, unreliable verdicts

What they're good at: total sleep duration, bedtime regularity, and trends over weeks (consumer wearables estimate total sleep time reasonably well). Great for accountability on a fixed schedule and spotting the effect of alcohol/late caffeine.
What they're bad at: per-stage accuracy (light/deep/REM) is mediocre vs lab polysomnography — treat stage breakdowns as rough. A single night's "sleep score" is noisy.
Beware "orthosomnia." Anxiety about hitting a perfect sleep score can itself cause insomnia. If a low score ruins your morning, the tracker is now the problem — use it for weekly trends, not nightly grades, and trust how you actually feel. The gold standard for diagnosis remains an in-lab or validated home sleep study ordered by a clinician.

Red flags — see a doctor

Sleep hygiene won't fix an underlying disorder. Seek evaluation if you have:

Obstructive sleep apnea (OSA). Loud snoring with witnessed gasping/choking, waking unrefreshed, morning headaches, heavy daytime sleepiness. Screen with STOP-BANG (Snoring, Tiredness, Observed apnea, Pressure/BP, BMI>35, Age>50, Neck>40 cm, male) — ≥3 = elevated risk. Severity by AHI (events/hr): 5–15 mild, 15–30 moderate, >30 severe. Highly treatable (CPAP, oral appliance, weight loss).
Chronic insomnia. Trouble falling/staying asleep ≥3 nights/week for ≥3 months with daytime impairment. → ask about CBT-I.
Restless legs syndrome (RLS). Irresistible urge to move the legs at rest/evening, relieved by movement. Check ferritin (iron); avoid triggers.
Excessive daytime sleepiness / sleep attacks. Falling asleep involuntarily, cataplexy, sleep paralysis, hallucinations → rule out narcolepsy. Dangerous if driving.
Acting out dreams (REM behavior disorder), sleepwalking with injury risk, or violent night terrors.
Persistent extreme schedule mismatch (can't sleep before 3 am no matter what) → circadian rhythm disorder (e.g. DSPS) needing timed light/melatonin.

Common mistakes & anti-patterns

Sleeping in on weekends. Feels restorative, but re-delays your clock and wrecks Monday. Keep the wake time; nap briefly if needed.
Using alcohol as a sleep aid. It's a sedative, not a sleep aid — it destroys the back half of the night.
Lying in bed trying harder to sleep. Effort raises arousal. Get up after ~20 min and reset.
Clock-watching. Doing the math on "only 4 hours left" spikes anxiety. Turn the clock away.
Mega-dose melatonin (5–10 mg). More isn't better; it causes grogginess and overshoots the physiological signal. 0.5–1 mg, timed.
Chasing a perfect tracker score. Orthosomnia. Weekly trends > nightly grades.
"Catching up" on no sleep all week. Weekend recovery is partial; consistency beats binge-and-purge sleep.
Late-night doomscrolling. It's the light and the cognitive/emotional arousal. Phone out of the bedroom.
Treating snoring as harmless. Loud snoring + gasping can be OSA — a cardiovascular risk, not a quirk. Get screened.
Relying on sleep hygiene alone for real insomnia. It's the weakest CBT-I component. Add stimulus control + sleep restriction.