Why You Get a Headache When You Wake Up

Morning headaches are surprisingly common, and they usually trace back to something happening during the night that you’re not aware of. The cause can range from something as simple as your pillow to something worth investigating like a breathing disorder during sleep. Understanding the pattern of your headache, where it hurts, and how long it lasts can help you narrow down what’s going on.

Sleep Apnea and Oxygen Drops

One of the most frequent medical causes of waking headaches is obstructive sleep apnea, a condition where your airway partially or fully collapses during sleep. When this happens, your blood oxygen levels drop repeatedly throughout the night. That oxygen desaturation causes blood vessels in the brain to widen, and this dilation can trigger a headache that’s waiting for you when you open your eyes.

Studies published in JAMA Internal Medicine found a positive correlation between the degree of oxygen desaturation overnight and the likelihood of waking up with a headache. These headaches tend to feel like a dull, pressing pain on both sides of the head. They usually fade within an hour or so of being awake and breathing normally. If you snore loudly, wake up gasping, or feel exhausted despite a full night of sleep, apnea is worth looking into. A sleep study is the standard way to confirm or rule it out.

Teeth Grinding and Jaw Clenching

Sleep bruxism, the unconscious grinding or clenching of your teeth while you sleep, is a common and often overlooked cause. It’s classified as a sleep-related movement disorder, and many people have no idea they do it until a dentist notices wear on their teeth or a partner hears the grinding at night.

The telltale headache from bruxism is a dull ache at your temples, the area between your forehead and ears. You might also notice a tired or tight jaw when you wake up, soreness in your face or neck, or a jaw that pops and clicks when you open your mouth. Over time, the repeated strain on the temporomandibular joints (the hinges just in front of your ears) can produce tension-type headaches that show up reliably every morning. A dentist can fit you with a night guard that cushions the force and often resolves the headaches within weeks.

Your Pillow and Sleep Position

The way your neck is supported overnight has a direct effect on whether you wake up with head pain. A study in the Journal of Pain Research tested different pillow types on side sleepers and found clear differences. Latex pillows performed best for reducing waking headaches and neck or shoulder pain. Feather pillows performed worst, producing the highest frequency of symptoms and the most people who abandoned the pillow mid-study. Foam contour pillows, the kind marketed specifically for neck support, performed no better than regular flat foam pillows.

If your headache tends to start at the base of your skull and radiate upward, your pillow or sleeping position is a likely contributor. Side sleepers need a pillow thick enough to fill the gap between their shoulder and ear, keeping the spine neutral. Stomach sleeping forces the neck into rotation for hours and is one of the most reliable ways to wake up with a headache.

Caffeine Withdrawal Overnight

If you drink coffee or tea regularly, your brain adapts to the steady presence of caffeine. During sleep, you go 7 to 9 hours without any, and for heavy drinkers that’s long enough to tip into early withdrawal. Caffeine withdrawal symptoms begin 12 to 24 hours after your last dose, peak between 20 and 51 hours, and can persist for up to 9 days. Headache is the most common symptom, reported in up to 50% of cases.

The math is straightforward: if your last cup of coffee is at 2 p.m. and you wake at 6 a.m., that’s 16 hours, well within the window for withdrawal to start. These headaches typically feel like a generalized, throbbing pain that improves shortly after your first dose of caffeine in the morning. If your morning headache reliably disappears after coffee, this is probably the mechanism. You can either accept the pattern or gradually reduce your intake over a week or two to reset your baseline.

Dehydration During the Night

You lose water steadily through breathing and sweating while you sleep, and you’re not replacing any of it for hours. If you went to bed slightly dehydrated, or if your bedroom is warm and dry, you can wake up with a meaningful fluid deficit. When you’re dehydrated, your brain tissue contracts slightly and pulls away from the skull, putting pressure on surrounding nerves. That’s the pain you feel.

Alcohol makes this significantly worse. It acts as a diuretic, increasing urine output and accelerating fluid loss overnight. The classic morning-after headache is largely a dehydration headache. Drinking a glass of water before bed and keeping water on your nightstand is the simplest intervention. If your headaches are worse in dry winter months or when you run a heater at night, dehydration is a strong suspect.

Medication Overuse Headaches

This one catches people off guard: the very painkillers you take for headaches can start causing them if used too frequently. The threshold depends on the type of medication. For common over-the-counter options like ibuprofen or acetaminophen, using them on 15 or more days per month for over 3 months can trigger a cycle of rebound headaches. For stronger medications like combination analgesics or opioids, the threshold is lower, just 10 days per month.

Medication overuse headaches often show up first thing in the morning because the last dose has worn off overnight. They tend to improve briefly after taking another dose, which reinforces the cycle. Breaking this pattern requires gradually reducing the medication, and the headaches typically get worse for a short period before they improve. If you’ve been reaching for painkillers most days of the week for months, this is worth considering seriously.

Hypnic Headaches

A less common but distinctive cause is hypnic headache, sometimes called “alarm clock headache” because it wakes people from sleep at a consistent time, often in the early morning hours. This is a primary headache disorder, meaning it’s the condition itself rather than a symptom of something else. It typically appears after age 50, though younger cases have been reported.

Hypnic headaches produce a dull pain that lasts anywhere from 15 minutes to 4 hours after waking, with an average duration of about 2 hours. They tend to recur on multiple nights per week. If you’re being woken from sleep by a headache at roughly the same time each night, particularly if you’re over 50, this pattern is worth mentioning to your doctor. Caffeine before bed is, counterintuitively, one of the treatments that works for some people.

Warning Signs That Need Attention

Most morning headaches trace back to one of the causes above and respond well to straightforward fixes. But headaches that are worse in the morning can also be a symptom of increased pressure inside the skull, which happens with conditions like brain tumors. About half of people with brain tumors experience headaches, and the pain is characteristically worse in the morning because lying flat overnight allows pressure to build.

The features that set these apart from benign morning headaches are important to recognize. Headaches that are progressively getting worse over weeks, that come with nausea or vomiting (especially in the morning), that cause visual changes like blurry or double vision, or that arrive alongside new neurological symptoms like weakness in an arm or leg, balance problems, or speech difficulty are all reasons to get evaluated promptly. A headache that’s been the same for years and responds to coffee or water is a very different situation from one that started recently and is steadily intensifying.