Ask people with migraine about coffee and you will get two confident, opposite answers. One person swears a cup at the first flicker of an aura saves their day. Another traces half their attacks to the second latte. The research says both people can be right, and that the difference mostly comes down to dose, regularity and what happens when the habit changes.

This page lays out what the main studies found, with the numbers and their limits, and then turns it into a routine you can test on yourself. It is a sourced explainer, not medical advice. Migraine is a medical condition with its own treatments, and anyone with frequent attacks, new symptoms or a medication plan should treat what follows as questions for their own clinician.

The short version

  • A six-week diary study of 98 adults with episodic migraine found no clear link between one or two caffeinated drinks a day and migraine that day, but higher odds on days with three or more.
  • An abrupt stop is its own trigger: in a small crossover trial, withdrawal brought on severe attacks in seven of nine people who stayed in the study.
  • Caffeine also works as a treatment: a Cochrane review found that adding about a mug of coffee’s worth of caffeine to a standard painkiller helped 5 to 10 percent more people get good relief.
  • The American Migraine Foundation says doctors recommend people with episodic migraine limit caffeine to one or two beverages a day, or about 200mg.
  • The most protective habit in the evidence is consistency, not abstinence.

Why caffeine is both a trigger and a treatment

A 2020 review in the journal Nutrients put the paradox in its opening line: caffeine has been linked with migraine for many years, “on the one hand as a trigger, and on the other hand as a cure.” The authors reviewed 21 studies on caffeine as a trigger and 7 on its therapeutic use. Their finding on triggers was modest: caffeine or caffeine withdrawal was reported as a migraine trigger in a small share of participants, ranging from 2 to 30 percent depending on the study. On treatment, caffeine worked when combined with other analgesics.

Their conclusion is worth reading slowly. There was insufficient evidence to recommend caffeine cessation to all migraine patients. But excessive consumption may worsen migraine, sudden withdrawal can trigger attacks, and they suggested people with migraine limit intake to 200mg a day and keep it consistent.

That is the useful frame. Caffeine is not a universal villain and not a cure. It is a drug with a dose-response curve and a withdrawal phase, and migraine brains appear to be sensitive to both ends of it.

The diary study: where three drinks seems to be the line

Person with several coffee cups on table
Photo by Cristina Tiris on Pexels

The most practical dataset comes from Elizabeth Mostofsky and colleagues, published in The American Journal of Medicine in 2019. They followed 98 adults with episodic migraine (86 women and 12 men, mean age about 35) who filled in electronic diaries twice a day for at least six weeks, logging caffeinated drinks, other lifestyle factors and each headache. Between them they recorded 825 migraines across 4,467 days of observation.

The headline result was a statistically significant nonlinear association between the number of caffeinated drinks and the odds of a migraine that day (P = 0.024). In the investigators’ words, one or two caffeinated beverages in a day did not appear to be linked to developing a migraine, but three or more servings may be associated with higher odds. NBC News, reporting the study, gave the figures as roughly 1.4 times the odds on days with three or more drinks, and about 2.6 times the odds with five or more.

What the study does and does not support

Several details keep that number honest:

  • Small and mostly female. Ninety-eight people is a small sample, and the findings may not transfer to everyone.
  • Individual levels were not significant on their own. The summary of the study notes that estimates for each separate level of intake were not statistically significant. The finding is the overall curve, not a precise cutoff.
  • Habit changes the picture. The study reported that the association varied with usual consumption. NBC’s report adds that among people who rarely consume caffeine, even one or two servings could raise the chance of a headache that day.
  • A “serving” is a count, not a measurement. The study counted drinks, not milligrams. A tea, an espresso and an energy drink are very different doses.
  • Timing was same day. The authors say more work is needed on onset in the following hours and on how sleep, anxiety and environment interact with caffeine and migraine.

So the defensible reading is a pattern, not a rule: for people who drink caffeine regularly, a couple of drinks a day looked safe in this sample, and a heavy day looked riskier. Someone who has coffee twice a year may react differently from a daily drinker.

Withdrawal: the trigger people forget

If three drinks can be a problem, the obvious fix is to quit. The best trial we have on that suggests the fix can be worse than the problem.

Alstadhaug and colleagues in Norway ran a randomized, double-blind crossover study, published in Frontiers in Neurology in 2020. It was designed to enroll 80 adults with episodic migraine who consumed 300 to 800mg of caffeine a day. Participants swapped their dietary caffeine for either placebo capsules or caffeine tablets for five weeks, then switched for five more.

The trial was stopped early because of low recruitment, and only ten people enrolled, with an average intake of 539mg a day. One person left just after entering. Of the remaining nine, withdrawal triggered severe migraine attacks in seven (one of them dropped out as a result) and a typical caffeine withdrawal syndrome in two. Continuing caffeine did not trigger migraines, although one attack followed reintroduction. The authors say plainly that the study failed to answer how withdrawal affects migraine over time, but it did show that abrupt withdrawal of caffeine is a potent trigger.

Ten people is not a basis for firm numbers, and these were heavy consumers well above the 200mg level. What it adds is direction: stopping suddenly after a high intake is risky for someone with migraine, which matches the American Migraine Foundation’s warning that withdrawal can itself be a trigger. Our caffeine withdrawal timeline covers the usual onset window and what a gradual taper looks like.

How fast dependence builds

The Foundation notes that dependency can develop within seven days at just 100mg a day. That is roughly one strong cup, which is why the “I only have one” drinker can still get a headache on the day they skip it. It is also why weekend headaches are a classic pattern: the weekday dose stops, or arrives three hours late.

Caffeine as treatment: what the Cochrane review found

Pain relief medication tablets and capsules
Photo by Anna Shvets on Pexels

Many over-the-counter headache medicines contain caffeine, and there is a reason. A 2014 Cochrane review by Derry, Derry and Moore pooled 20 studies with 7,238 participants across several acute pain types, including headache, dental pain and postpartum pain. Caffeine doses of 100 to 130mg, about a mug of coffee, added to a standard dose of common analgesics gave about 5 to 10 percent more people a good level of pain relief. The number needed to treat was about 14. The reviewers found no serious adverse events related to either the analgesic or the caffeine (low quality evidence) and said it is unlikely that adding caffeine to an analgesic will be harmful if the recommended dose is not exceeded.

Two cautions. First, the review did not report headache separately in the summary available, so it is evidence about acute pain in general, not a migraine trial. Second, a 5 to 10 percent improvement is real but modest. It does not mean a cup of coffee alone will stop an attack, and the American Migraine Foundation says only that small amounts of caffeine may give mild relief. It also notes that some over-the-counter products include caffeine partly to aid absorption, which makes it harder to tell when caffeine is helping and when it is feeding a cycle of use.

Putting the numbers in cups

The Foundation’s 200mg guidance is easier to use when you convert it to what is in your actual drink. Using this site’s own figures:

Bar chart of caffeine in mg for espresso shots, Starbucks Pike Place and instant coffee, relevant to migraine and the 200mg guidance
Data: measurements cited in this article
Drink Approximate caffeine Source on this site
Espresso shot (USDA value) 63mg Caffeine in an espresso shot
Espresso shot (median of 20 cafes) 140mg Caffeine in an espresso shot
Starbucks Pike Place, 8oz 155mg Starbucks brewed coffee
Instant coffee, 8oz 57mg (one guide) Instant coffee caffeine
Decaf, 8oz roughly 2 to 15mg Decaf caffeine content

The point is that “two drinks” can mean 130mg or 310mg depending on where you buy them. The study counted drinks, the Foundation’s guidance speaks in milligrams, and a cafe double can use up the whole allowance in one cup.

Worked example: a four-week test on yourself

This is a self-observation routine, not a treatment plan. It borrows the diary method of the Mostofsky study, which is the reason that study found anything.

Say someone has migraine two or three times a month, drinks a large cafe coffee in the morning (around 300mg) and a second one after lunch, and wonders whether coffee is part of it.

  1. Log for two weeks without changing anything. Write down every caffeinated drink with a rough milligram figure, plus sleep, stress, meals, and each headache with its start time. Include tea, soda, chocolate, energy drinks and pain relievers that contain caffeine. The American Migraine Foundation also lists decaf and some non-cola sodas as hidden sources.
  2. Add it up. Here the total is about 600mg a day, three times the 200mg guidance, even though it is only “two coffees.”
  3. Look for patterns. Do attacks cluster on days with an extra cup, late nights, skipped drinks, or weekends?
  4. Taper, do not quit. The Foundation suggests cutting by about 25 percent a week rather than going cold turkey. From 600mg that is roughly 450, 300, then about 150 to 200mg over three weeks. Swapping one cup for a half-decaf blend or a smaller size is a simple way to step down.
  5. Keep it steady. Whatever level you land on, have it at consistent times every day, including weekends. Consistency is the one recommendation the Nutrients review and the Foundation share.
  6. Review with your clinician. Bring the diary. It is more useful to a headache specialist than the sentence “I think coffee is a trigger.”

Hydration comes up in the Foundation’s guidance too: it says caffeinated drinks can affect migraine symptoms indirectly by causing dehydration, and suggests adding a full glass of water for each cup. Treat that as a cheap habit, not a proven fix.

Where this connects to other caffeine topics

Migraine overlaps with the rest of the “caffeine and your body” material on this site. Sleep loss is a classic migraine trigger, and late-day caffeine can erode sleep. The coffee and anxiety guide covers the jitters and sleep side, and the coffee and cortisol guide covers how the body adapts to a steady dose, which is part of why a regular intake is easier on the system than a stop-start one.

What this evidence does not tell you

  • It does not say coffee causes migraine. The strongest data is a small diary study showing an association on the same day. It cannot separate coffee from the things that tend to come with it, such as poor sleep, stress and skipped meals.
  • It does not give you a personal limit. The 200mg and two-drink figures are population-level guidance. Some people with migraine do fine on more, and some react to less.
  • It does not mean everyone should quit. The Nutrients review explicitly found insufficient evidence to recommend cessation for all patients, and the withdrawal trial suggests quitting abruptly can make things worse.
  • It does not mean caffeine is a safe rescue for every attack. The Cochrane benefit is for caffeine added to a standard analgesic, across several kinds of pain. The Foundation advises that people with daily headaches should consider avoiding caffeine, and frequent use of acute treatments is something to discuss with a doctor.
  • It does not replace a diagnosis. New, sudden or severe headaches need medical attention.

Common mistakes

The first mistake is counting drinks instead of milligrams, so two large cafe coffees pass for “moderate.” The second is quitting overnight after an attack and then blaming the next attack on something else. The third is skipping weekend coffee and getting a Saturday headache that gets blamed on the week. The fourth is forgetting caffeine in headache tablets, tea, soda and chocolate when adding up the day. The fifth is changing three things at once, so the diary cannot show which one mattered. And the last is treating the Cochrane figure as proof that a strong coffee is a migraine treatment, when it describes a small boost on top of a painkiller.

Common questions

Does coffee cause migraines? Not reliably. In a 98-person diary study, one or two caffeinated drinks a day were not clearly linked to migraine, while three or more were linked to higher odds that day. A 2020 review found caffeine or its withdrawal was a trigger for 2 to 30 percent of people in the studies it covered.

Can coffee help a migraine? Sometimes. The Cochrane review found that about 100 to 130mg of caffeine added to a standard painkiller gave 5 to 10 percent more people good pain relief across several pain types. The American Migraine Foundation says small doses may give mild relief, but that people who regularly consume large quantities may be at risk of withdrawal symptoms if they quit cold turkey, and withdrawal can itself be a migraine trigger.

How much coffee is too much if I get migraines? The Foundation says doctors recommend people with episodic migraine limit caffeine to one or two beverages a day, or about 200mg. It suggests people with daily headaches consider avoiding it. Because drinks vary so much in strength, the milligram figure is the better guide.

Should I quit coffee to stop migraines? Not necessarily. The Nutrients review found insufficient evidence to recommend quitting for everyone. In the withdrawal trial, abrupt cessation triggered severe attacks in seven of nine heavy-caffeine participants. If you cut back, the Foundation suggests reducing by about 25 percent a week.

Why do I get a headache on weekends or days I skip coffee? That is the classic withdrawal pattern. The Foundation says dependency can form within seven days at 100mg a day, and that daily caffeine intake can lead to withdrawal headaches. Having your caffeine at the same time every day helps.

Is decaf safe for migraine? Decaf has far less caffeine, roughly 2 to 15mg a cup in the figures we cover, so it is a common step-down tool. The Foundation notes decaf is still a small hidden source, so count it if you are tracking closely.

Does cold brew or espresso make a difference? The studies counted drinks, not brew methods, so none of them can say. What matters for migraine is the milligram total and its consistency. Our espresso shot guide shows how widely a single cafe shot can vary.