Migraine and Sleep: Why You Wake Up With a Headache
You wake up with a headache. It's becoming a pattern. You start dreading mornings, sleeping badly because you know what's coming.
Or the opposite: you sleep in on the weekend to catch up on the week, and boom, migraine by mid-morning.
Or another scenario: since your migraines became frequent, you can't sleep properly anymore, and your attacks are getting worse.
These three scenarios reflect the complex bidirectional relationship between migraine and sleep. Sleep affects migraine, and migraine affects sleep. It's a cycle that can become vicious — or virtuous if you understand the mechanisms.
This article explains exactly how your sleep affects your migraines, how to identify if your attacks are sleep-related, and the concrete levers to optimize your sleep and reduce attack frequency.
Sleep: both a trigger AND a protector for migraine
Sleep has a paradoxical effect on migraine:
When dysregulated, it triggers attacks. Sleep deprivation, poor sleep quality, irregular schedules, oversleeping: all these are documented triggers.
When proper, it helps prevent attacks. Good, regular sleep hygiene is one of the most effective preventive levers, free and side-effect-free.
When you're having an attack, sleeping can help stop it. Many migraineurs find that an hour of deep sleep after taking medication helps shorten the attack.
This double effect is significant: your sleep is probably one of the most powerful levers you have to influence your migraines, after medication.
The 4 sleep-migraine patterns to recognize
Pattern 1: Migraine on waking
You wake up already with the migraine, or it hits within an hour of waking. This is the most common sleep-related pattern.
Possible causes:
- Undiagnosed sleep apnea (top priority to investigate, see below)
- Nighttime bruxism (teeth grinding) creating tension
- Poor sleep position (pillow too high/low, sleeping on stomach)
- Morning caffeine withdrawal (rebound effect)
- Nighttime hypoglycemia (overly long overnight fast)
- Medication overuse headache (see our article on why you have a headache every day)
Important: waking up in pain doesn't necessarily mean a migraine. It could be a tension-type headache (band-like pain, both sides, mild). The distinction matters because solutions differ.
Pattern 2: Migraine after sleeping in
You sleep fine during the week, but on Saturday morning you sleep in, and you wake up with a migraine. The classic "weekend migraine" pattern.
Mechanisms involved:
- Circadian rhythm shift: your brain expects regularity
- Caffeine withdrawal: you have your coffee at 7am during the week, now you sleep until 11am, your brain "misses" the caffeine
- Stress let-down
- Prolonged hypoglycemia
Our article on stress and migraines details the let-down phenomenon that co-triggers weekend migraines.
Pattern 3: Insomnia worsening attacks
You've always had migraines, but recently you sleep poorly (stress, anxiety, pain, grief, life event), and your attacks are more frequent or more intense.
It's a vicious cycle:
- You sleep poorly → you have more attacks
- You have more attacks → you dread the night, you sleep less well
- You sleep less well → you have even more attacks
Striking statistic: roughly 50% of migraineurs also suffer from chronic insomnia, vs. roughly 15% in the general population.
Pattern 4: Hypnic headache (rare)
You wake up in the middle of the night, always around the same time (often between 1am and 4am), with a headache that pulls you out of sleep.
Diagnostic criteria (per ICHD-3): headaches that develop only during sleep, that wake you up, occurring at least 10 days per month for more than 3 months.
It's a rare form (less than 0.1% of the population), distinct from migraine. Mainly affects people over 50. If this pattern matches you, see a neurologist: a specific treatment exists (caffeine or indomethacin at bedtime).
Sleep apnea: the underdiagnosed cause
Here's a critical point that many migraineurs miss.
Obstructive sleep apnea (OSA) causes repeated breathing pauses during the night, which:
- Fragments your sleep (micro-awakenings) → known migraine trigger
- Decreases brain oxygenation (hypoxia) → vasodilation → pain
- Increases blood CO₂ (hypercapnia) → vasodilation → pain
Important statistics:
- Migraineurs are 2-8 times more likely to have sleep disorders than the general population
- In OSA patients, morning headaches resolve in roughly 90% of cases when apnea is treated (with CPAP — Continuous Positive Airway Pressure)
- The risk of apnea increases sharply in migraineurs after age 50
- Frequent morning headaches and awakening headaches are directly linked to hypoxemia and hypercapnia during apneic episodes
When to suspect sleep apnea
Warning signs to watch for:
- Loud, habitual snoring (reported by your bed partner)
- Witnessed breathing pauses during sleep
- Feeling unrested despite 7-8 hours of sleep
- Intense daytime fatigue, daytime sleepiness
- Near-daily morning headaches (key sign)
- Neck circumference greater than 17 inches (men) or 15 inches (women)
- Overweight (BMI > 25)
- High blood pressure
If you have more than 3 of these, bring it up with your doctor. Simple screening via questionnaires (Epworth, STOP-BANG) and if needed a home sleep study can confirm the diagnosis.
Treating sleep apnea when you have it can potentially eliminate 50-90% of your morning migraines. It's the most worthwhile investigation possible.
How many hours of sleep does a migraineur need?
Contrary to popular belief, more is not better. For a migraineur, the goal isn't to sleep 10 hours, but to sleep regularly.
The golden rule: regularity wins
Your migraine-prone brain is particularly sensitive to variations. It's better to:
- Sleep 7 hours every day at consistent times
- Than 9 hours on weekends and 6 hours on weekdays
Adult sleep ranges
For most adults, 7 to 9 hours per night is the recommended range. But what matters for you as a migraineur is your personal range, identified through tracking.
The oversleeping trap
Sleeping too long (>9 hours) is a trigger just as powerful as sleeping too little, but much less recognized. Why:
- Circadian rhythm shift
- Prolonged caffeine withdrawal
- Prolonged hypoglycemia
- Extended REM sleep phases (potential trigger)
No sleeping in more than 1 hour past your usual time, even on weekends. If you're in sleep debt, take a short nap (20-30 min) in the afternoon rather than sleeping in the next day.
10 concrete levers to optimize your migraine-prone sleep
1. Fixed schedule (the #1 lever)
Go to bed and wake up at the same time every day, weekends included. Tolerance: ±30 minutes max. This is the most powerful lever to stabilize your sleep and reduce attacks.
2. Avoid screens 1 hour before bed
Blue light delays melatonin secretion. Activate night mode on your phone after 9pm, or better, read a paper book.
3. Cool, dark bedroom
Optimal temperature: 65-67°F (18-19°C). Total darkness (blackout curtains, sleep mask if needed). Heat and light fragment sleep.
4. No caffeine after 2pm
Caffeine has a 5-6 hour half-life. A coffee at 4pm is still active at 10pm. Herbal teas, decaf, or water after 2pm.
5. Limit alcohol
Alcohol makes you fall asleep fast but fragments the second half of the night (rebound waking). And alcohol is also a direct migraine trigger. See our article on migraine and food.
6. Light evening meals
Meals too fatty, too sugary, or too late → digestion that disrupts sleep. Ideally: dinner 2-3 hours before bed, light meal.
7. Regular physical activity
30 minutes of moderate exercise 3-5x/week improves sleep quality. But not within 3 hours of bedtime (it activates the nervous system).
8. No screens in bed
Bed = sleep and sex, not Netflix or TikTok. This rule conditions your brain to associate the bed with sleep.
9. Bedtime routine
30 minutes of calming ritual: warm shower, reading, meditation, gentle stretching. Your brain learns to anticipate sleep.
10. If you wake up at night
If you wake up and can't fall back asleep within 20 minutes, get up. Go to another room, do a calm activity in dim light (reading, journaling), come back to bed when you feel sleepy. Better than tossing and ruminating in bed.
Melatonin: a supplement that may help
Melatonin, the natural sleep-onset hormone, can help regularize sleep for some migraineurs. More interesting still: it has shown a modest preventive effect on migraine in several studies.
Indicative dosage: 0.5 to 3 mg, 30 to 60 minutes before bed, at consistent times.
Potential double benefit: better sleep onset + migraine preventive effect.
⚠️ Precautions: consult your doctor before taking melatonin if you take antidepressants, anticoagulants, or have an autoimmune condition. Melatonin is available over-the-counter in the U.S. at standard doses; in the UK and many other countries, it's prescription-only.
How to track the sleep-migraine link
To identify if YOUR migraines are linked to YOUR sleep, you need to track in parallel for at least 4-6 weeks:
- Bedtime and wake time (and sleep duration)
- Subjective sleep quality (score out of 10)
- Nighttime awakenings (how many, what time)
- Feeling on waking (rested, tired, already with headache)
- Your migraine attacks (start time, duration, intensity)
After 15-20 tracked attacks, you can look for recurring patterns:
- Do your attacks happen more often on days when you slept less?
- Is there a typical delay between a bad night and an attack (often 24-48h, not immediate)?
- Do your morning attacks correspond to nights of poor quality?
With this precise data, you can then act in a targeted way: optimize sleep schedules on sensitive days, identify potential apnea, adjust your habits.
Our article on how to identify your migraine triggers details the complete tracking method.
That's exactly what we built Mellow for: track in seconds per day, automatically cross-reference sleep and attack data, and surface the patterns that actually concern you. More effective than thinking "I think I sleep badly" — you know EXACTLY how your sleep influences your attacks.
Sources
Mayo Clinic — Sleep apnea: Symptoms and causes. mayoclinic.org
American Migraine Foundation — Sleep Disorders and Headache. americanmigrainefoundation.org
The Migraine Trust — Sleep and migraine. migrainetrust.org
Sleep Foundation — Sleep Apnea Headaches. sleepfoundation.org
Tiseo C, Vacca A, Felbush A et al. — Migraine and sleep disorders: a systematic review. The Journal of Headache and Pain, 2020. ncbi.nlm.nih.gov
Rains JC — Sleep Disorders Among People With Migraine: Results From the Chronic Migraine Epidemiology and Outcomes (CaMEO) Study. PMC. ncbi.nlm.nih.gov
ICHD-3 (International Classification of Headache Disorders, 3rd edition) — Hypnic headache diagnostic criteria. ichd-3.org
NHS — Sleep apnoea. nhs.uk
Related articles
Migraine and Food: Which Foods Trigger or Protect Against Attacks?
Tyramine, histamine, MSG, alcohol, chocolate: complete guide to migraine-triggering foods and protective foods. Method to identify your personal triggers.
Menstrual Migraine: When Periods Trigger Migraine Attacks
Pure or menstrually-related migraine: criteria, hormonal causes, acute treatments, and short-term prevention with triptans, estrogen gel, magnesium. Complete guide.
Triptans Explained: A Complete Guide to These Anti-Migraine Drugs
Sumatriptan, zolmitriptan, rizatriptan: how triptans work, which one to choose, side effects, contraindications. The complete guide.