Fasting Guide · Headaches and Migraine

Fasting and Migraine: Why Fasting Can Trigger Headaches and How You Can Prevent Them

Headaches during fasting are common, especially on the first day and in people with migraine. Usually several factors work together: caffeine, water, salt, energy metabolism, sleep and a sensitive nervous system. Here you can read what studies show and what you can do to prevent them.

Fasting headache Caffeine withdrawal Water and salt Migraine Warning signs 35 sources with DOI
SJ Shukri Jarmoukli · Physician, Integrative Medicine · ViveCura Berlin
Why I'm writing this

A headache during fasting is no proof that fasting isn't for you. It is more of a message about your preparation: about coffee, water, salt, sleep, and how sensitively your head reacts to change.

Maybe you know this moment.

Day one of your fast. The morning went surprisingly well. No breakfast, no problem.

Around three in the afternoon, a dull pressure builds behind your forehead. Like a band slowly tightening. Then it occurs to you that you haven't had any coffee today either.

In the evening, you read in a forum: That's normal, it'll pass. Maybe that's true. But it doesn't feel like an answer.

If you recognize yourself here, you are in good company. Headache is one of the most common complaints during fasting. And if you live with migraine, the worry about fasting is often bigger than the hunger.

I want to give you more than a shrug. This article is about three questions. How common are headaches during fasting? Which factors has research identified? And what can you prepare so that your head stays calmer?

How to ease gently into fasting is covered in Fasting for beginners. What coffee does to your fast is explained in What breaks a fast? This article is about your head.

What you can expect in this article

  • How common headaches during fasting are
  • Five factors that studies discuss
  • Why caffeine withdrawal so often plays a part
  • What blood sugar and ketones have to do with it
  • Water, salt and magnesium, honestly assessed
  • Why fasting can be a stronger trigger with migraine
  • Three levers for your next fasting day
  • Warning signs that need medical evaluation

How I label the evidence

Clinical study Controlled studies in humans, mostly randomized, as well as meta-analyses.

Human observation Surveys, observational studies, case series and reviews. They show associations, not necessarily cause and effect.

Animal study Experiments in animals. They explain possible mechanisms, but do not automatically apply to humans.

Is a headache during fasting normal? What studies show about how common it is

In short: Headache during fasting is common. In studies on religious fasting days, around four in ten people who fasted developed headaches, compared with fewer than one in ten of those who did not fast. The risk rises with the length of the fast and is clearly higher in people with a history of headaches. Typical is a pressing headache on both sides that improves after eating.

Maybe you wonder whether something is wrong with you because others seem to fast effortlessly. The numbers tell a different story.

The Yom Kippur study

Human observation A team at Tel Aviv University led by Mosek and Korczyn surveyed 370 hospital employees before and right after the 25-hour fast of Yom Kippur. Of the 211 people who fasted, 39 percent developed headaches, compared with only 7 percent of those who did not fast. People who were already prone to headaches were affected much more often: 66 versus 29 percent.

What this means for you: If your head reacts to fasting, that is not a sign of weakness but a well-described pattern.

Mosek A, Korczyn AD. Neurology. 1995. DOI: 10.1212/wnl.45.11.1953

In this study, the pain was mostly non-throbbing, mild to moderate, on both sides and at the forehead. With every hour of fasting, the number of people affected rose. A survey of hospital staff in Riyadh painted a similar picture on the first day of Ramadan. Of those fasting, 41 percent had headaches, but only 8 percent of those not fasting. In 78 percent of cases, the pain resembled a tension-type headache.

The International Classification of Headache Disorders therefore lists headache attributed to fasting as a diagnosis in its own right. A review from Parma describes it as diffuse or concentrated at the forehead, non-throbbing and mild to moderate. In a Danish population study, 4.1 percent of people had experienced it at least once in their lives. It usually subsides within 72 hours after you start eating again.

39% vs. 7%Headache in people fasting and not fasting on Yom Kippur
66% vs. 29%Fasting headache with and without a history of headaches
41% vs. 8%First day of Ramadan, fasting and not fasting
33% to 11%Headache on day 1 and on day 7 of Ramadan

The pattern repeats: the beginning is the hardest phase. In a study from Riyadh with 173 participants analyzed, 33 percent had headaches on the first day of Ramadan, and by the seventh day it was 11 percent. A recent review from Denmark describes the same thing. Symptoms are strongest in the first days of fasting and usually ease afterwards.

Shift in perspective

The headache on the first day of fasting is usually not a verdict on you and no proof that fasting isn't for you. It can be a sign that your body has to cope with several changes at the same time.

That is exactly where the opportunity lies. Changes can be prepared for.

And now you know why the first day of fasting is rarely a good yardstick for your fasting.

Where do headaches during fasting come from? Five factors instead of one culprit

Maybe you have read that fasting headache is simply low blood sugar. Or dehydration. Or detox. Each of these explanations sounds convincing. None is enough on its own.

So far, research has not found a single trigger. A review from Parma names low blood sugar and caffeine withdrawal as particularly debated causes and emphasizes that much remains open. A 2026 review of 20 studies on Ramadan lists lack of fluids, caffeine withdrawal, low blood sugar, disrupted sleep and changed eating habits. The International Classification of Headache Disorders is even more cautious. It states that fasting headache can also occur without low blood sugar.

Imagine your head as a set of scales. On one side lies your sensitivity to pain. On the other side lie small weights: the missing coffee, one glass of water too few, a short night, an empty sugar store. Each weight alone would be no problem. Together, the scales can tip.

Factor 1

Caffeine withdrawal

If you drink coffee every day, on the first day you often fast from caffeine too. Withdrawal headache typically begins 12 to 24 hours after the last cup.

Factor 2

Energy in the brain

When sugar drops, the brain increasingly has to switch to ketones. The migraine brain appears to react sensitively to bottlenecks in energy supply.

Factor 3

Water and salt

In the first days of fasting, the kidneys excrete more sodium. If water and salt are then missing, this can put additional strain on your head.

Factor 4

Sleep and rhythm

Eating late, getting up early, a restless night: in studies on fasting, disrupted sleep is considered a possible contributor.

Factor 5

Sensitive nervous system

The strongest predictor is often your own headache history. People prone to migraine or tension-type headache react more often.

Background

And magnesium?

Magnesium is more of a building block for less migraine overall. For the individual fasting day, clear evidence is lacking.

Seen through the lens of Clinical Psychoneuroimmunology, four systems interlock here. None of them works alone.

Nervous system

The trigeminal nerve supplies the meninges with pain fibers. In a study from Riyadh, people fasting with headache had elevated levels of CGRP, a messenger substance these nerve fibers can release.

Metabolism

With every hour of fasting, the liver's sugar store empties, and the body increasingly produces ketones. This switch takes time and can feel like a mild flu in the first days.

Hormonal system

Insulin, glucagon and the satiety hormone leptin change during fasting. In an animal study in rats, exactly these hormones altered the transmission of pain signals in the trigeminal system.

Immune system

The fact that an anti-inflammatory drug had a preventive effect in studies suggests that inflammatory messengers could be involved. The inflammation marker CRP, however, was not elevated in fasting headache.

Shift in perspective

There isn't one single culprit. That may sound unsatisfying at first. For you, it is good news: where several weights lie on the scales, you can take several of them off.

And now you know why a single explanation for headaches during fasting is rarely enough.

Caffeine withdrawal: why your morning coffee has a say when you fast

Do you remember a morning without coffee? By midday your head felt heavy and your patience was short. The same often happens when you fast. Only this time, you don't recognize it as a coffee problem.

In the brain, caffeine occupies the docking sites for adenosine, a messenger that makes you tired and can widen blood vessels. Put simply: your brain gets used to its daily caffeine shield. If that shield suddenly disappears, adenosine can act unchecked, and your head speaks up.

The coffee study from Baltimore

Clinical study Researchers at Johns Hopkins University led by Silverman and Griffiths replaced the habitual caffeine of 62 adults with placebo under double-blind conditions. Participants consumed an average of 235 milligrams of caffeine a day, about two and a half cups of coffee. Without caffeine, 52 percent developed moderate to severe headaches, compared with 2 percent in the baseline phase.

What this means for you: Even a perfectly ordinary coffee habit can trigger noticeable headaches when you stop.

Silverman K et al. N Engl J Med. 1992. DOI: 10.1056/NEJM199210153271601

A large review from the US analyzed 57 experimental studies and 9 survey studies on caffeine withdrawal. In the experiments, headache occurred in half of the participants. Symptoms usually began 12 to 24 hours after the last caffeine, peaked after 20 to 51 hours and lasted two to nine days. Even giving up 100 milligrams a day, about one cup of coffee, could trigger symptoms.

Put these times next to a fasting day. If you drink your last coffee on the morning before you start fasting, the onset of possible withdrawal symptoms falls right into your first day of fasting.

In the survey from Riyadh, caffeine withdrawal was the most important external factor for headache on the first day of Ramadan. The authors suggested gradually reducing coffee intake in the weeks before Ramadan and drinking one more strong coffee right before the fast begins.

In people with migraine, abrupt withdrawal can hit particularly hard. In a small Norwegian study, participants consumed an average of around 540 milligrams of caffeine a day. The unnoticed switch to placebo triggered severe migraine attacks in 7 of 9 participants. The study was stopped early due to a lack of participants and is therefore only an indication.

An honest assessment

Not every study sees coffee as the main factor. In the Yom Kippur study from Tel Aviv, caffeine and nicotine withdrawal did not appear to influence the headaches. The International Classification of Headache Disorders also does not describe fasting headache as mere caffeine withdrawal.

My conclusion: Caffeine is an important factor, but not the only one.

More is not better, though. In a diary study from Boston with 98 people with migraine, the number of caffeinated drinks was not uniformly linked to migraine on the same day. The researchers interpret their data to mean that mainly larger amounts could be a trigger.

Caffeine check before fasting

  • Before a longer fast: Reduce your coffee gradually in the weeks before, instead of cutting it out abruptly on the first day of fasting.
  • With intermittent fasting: If your type of fasting allows black coffee, drink it at your usual time and in your usual amount. More on this in What breaks a fast?
  • With types of fasting without coffee: Don't schedule your first caffeine-free day on a day packed with deadlines.
  • Hidden sources: Black tea, green tea, mate, cola and energy drinks also contain caffeine.
Shift in perspective

If you drink coffee every morning, you often fast twice on the first day: from food and from caffeine. Separate the two changes, and your head only has to carry one of them.

And now you know why coffee deserves its own place in your fasting plan.

Blood sugar, ketones and a hungry brain: how much truth is there in the low blood sugar theory?

Shaky hands, irritability, a head wrapped in cotton wool. Many people immediately interpret this as low blood sugar. The feeling is real. The explanation is more complicated.

In healthy people, the body keeps blood sugar within range remarkably well during fasting. In a large observational study from the Buchinger Wilhelmi clinic with 1,422 people, blood sugar during therapeutic fasting dropped on average into the low normal range. At the same time, ketone bodies rose, a sign of the metabolic switch. Fewer than one percent of participants reported side effects.

The blood test study from Riyadh

Human biomarkers A team at King Saud University led by Alwhaibi took blood from 61 people fasting on the first day of Ramadan, before they reported on headaches. Fasting blood sugar, magnesium, the inflammation marker CRP and vitamins B9 and B12 did not differ between people with and without headache. The messenger substance CGRP, however, was elevated, with a median of 126.1 versus 105.8 picograms per milliliter.

What this means for you: Fasting headache seems to depend less on a measurable deficiency in the blood than on the sensitivity of your pain system.

Alwhaibi A et al. J Headache Pain. 2024. DOI: 10.1186/s10194-024-01886-0

An older study from 1971 fits this picture. There, artificially induced low blood sugar triggered migraine-like symptoms in only 2 of 20 people with migraine. So in healthy people who fast, true low blood sugar is probably rarely the main reason.

Energy still plays a role, though. A review in Nature Reviews Neurology describes migraine as a possible response of the brain to a mismatch between energy reserve and workload. According to this view, the attack could even be an attempt to restore the energy balance in the brain.

Imagine your brain as a data center that needs power around the clock. If the usual supplier fails, a backup generator kicks in: ketones. Switching over takes time. In that gap, a sensitive system can sound the alarm more quickly.

Hunger and pain in an animal model

Animal study A research group at King's College London led by Goadsby studied in rats how hormones of the fasting metabolism can act on pain pathways. Insulin, glucagon and leptin altered the transmission of pain signals in the trigeminal system. The researchers see this as a possible bridge between disturbed sugar regulation and migraine.

What this means for you: Hunger and pain systems are closely linked biologically. In humans, however, this mechanism has not yet been proven.

Martins-Oliveira M et al. Neurobiol Dis. 2017. DOI: 10.1016/j.nbd.2017.01.005

People experience a similar switch when they start a ketogenic diet. An analysis of online forums with 300 users found headache among the most common complaints of the so-called keto flu. Reports clustered at the beginning and became less frequent after four weeks.

The flip side is interesting. In an Italian observational study with 96 women with overweight and migraine, a very low calorie ketogenic diet lowered the number of attacks from 2.9 to 0.71 per month after one month. During the transition back to a normal diet, symptoms temporarily increased again. So ketosis itself does not seem to be the problem, but rather the transition.

For a gentler transition

  • The meal before: Protein, fat, vegetables and high-fiber carbohydrates instead of a sugar spike. Why blood sugar swings can drive hunger is explained in Cravings during intermittent fasting.
  • Increase gradually: Extend fasting periods slowly so that your metabolism can practice switching over.
  • Plan for ketosis: If you are deliberately aiming for it, expect a transition phase. How to recognize ketosis is covered in Recognizing ketosis during fasting.
  • Ease back in gently: Breaking your fast is also a transition. More on this in Breaking your fast the right way.
Shift in perspective

A headache during fasting is rarely an empty tank. More often, it could be a switching moment: your brain changes fuel, and a sensitive system speaks up in the gap.

And now you know why, with blood sugar, it is less about the lowest value than about the transition.

Water and salt: why your head can ask for salt when you fast

You get up from your desk, feel lightheaded for a moment, and your head is pounding. But you've had enough to drink. Haven't you?

The role of water is surprisingly controversial. In a follow-up study from Tel Aviv, 56 women weighed themselves before and after the 25-hour fast of Yom Kippur. Those who developed headaches had lost 1.4 kilograms on average, those who didn't, 1.2 kilograms. The difference was not statistically significant. The researchers concluded that dehydration on a single fasting day is probably not the main cause.

At the same time, lack of water is a well-known headache trigger. In a London case series, about one in ten people surveyed reported headache when short of fluids. In 22 of 34 of those affected, it disappeared within 30 minutes after they drank half a liter on average.

The water study from Maastricht

Clinical study A team at Maastricht University led by Spigt randomly assigned 102 people with recurrent headaches to two groups. Both received advice on stress and sleep, and one group was also asked to drink an extra 1.5 liters of water a day. After three months, migraine-specific quality of life in the water group rose by 4.5 points, and 47 percent reported a clear improvement compared with 25 percent. The number of days with at least moderate headaches, however, hardly changed.

What this means for you: Drinking enough is a sensible building block, but not a switch that simply turns headaches off.

Spigt M et al. Fam Pract. 2012. DOI: 10.1093/fampra/cmr112

And salt? This is where it gets physiological. In the first days of fasting, the kidneys excrete more sodium. This phenomenon has been described as the natriuresis of fasting since the 1970s at the latest. A paper in the New England Journal of Medicine examined the role of renin, aldosterone and glucagon in it. Water leaves along with the sodium. This can strain your circulation, especially when you stand up.

Imagine your circulation as a garden hose. If water and salt are missing, the pressure in the hose drops. Your body compensates for this, but during the transition phase it doesn't always manage right away.

An honest assessment

I am not aware of any controlled studies testing salt against fasting headache. In a US population study with 8,819 adults, people with a higher salt intake less often had a history of migraine or severe headaches. That is an association, not proof.

In a controlled nutrition study with 390 adults, on the other hand, less salt in everyday life was associated with fewer headaches. So salt is not a remedy where more is always better. During fasting, the point is to replace losses, not to salt as much as possible.

Water and salt on a fasting day

  • Drink throughout the day: Spread your drinking across the day instead of catching up with large amounts in the evening.
  • Salt during longer fasts: A small amount of salt, dissolved in water or as a clear broth, can be an option if your type of fasting allows it.
  • Get up slowly: If you feel dizzy when standing up, give your circulation a few seconds.
  • Check with your doctor: If you have high blood pressure, heart failure or kidney disease, discuss salt and fluid intake beforehand.

What risks longer water-only fasting can pose for your salt balance is covered in Water fasting: potential benefits and risks.

Shift in perspective

During fasting, salt is neither a free pass nor an enemy. It is a way to balance what your body gives up on its own in the first days.

And now you know why a glass of water is sometimes enough and sometimes it just isn't.

Magnesium: a foundation, not a fire extinguisher

Maybe there's already a pack of magnesium in your kitchen drawer, bought for calf cramps or stress. And maybe you've read that it is also the remedy for headaches during fasting.

For the individual fasting day, the data are thin. In the blood test study from Riyadh, magnesium levels were the same in people fasting with and without headache. So an acute magnesium deficiency as the trigger of fasting headache has not been shown.

For migraine overall, the picture is different. The evidence-based guideline of the American Academy of Neurology and the American Headache Society rates magnesium as probably effective for preventing migraine, at the second-highest level of evidence.

The magnesium study led from Munich

Clinical study A team led by Peikert gave 81 people with migraine either 600 milligrams of magnesium daily as trimagnesium dicitrate or a placebo for twelve weeks. In weeks 9 to 12, attack frequency fell by 41.6 percent with magnesium and by 15.8 percent with placebo. The most common side effect was diarrhea, at 18.6 percent.

What this means for you: Magnesium can be one building block of migraine prevention. But it takes weeks, not hours, and not every gut tolerates it well.

Peikert A et al. Cephalalgia. 1996. DOI: 10.1046/j.1468-2982.1996.1604257.x

Why might magnesium play a role in the head? It sits like a bouncer in certain docking sites for the excitatory messenger glutamate. In this way, it can help keep nerve cells from firing too easily. Based on current knowledge, it is still not a weapon against acute fasting headache.

Putting magnesium in perspective

  • With frequent migraine: Talk to your doctor about magnesium as a preventive building block. If you have kidney disease, magnesium belongs in medical hands only.
  • In your eating window: Nuts, seeds, legumes, whole grains and green leafy vegetables provide magnesium without any capsule.
  • Compare forms: How magnesium compounds differ is explained in Which magnesium is best?
Shift in perspective

Magnesium is more of a foundation than a fire extinguisher. Over weeks, it can help make migraine attacks less frequent. Based on current knowledge, it won't rescue an individual fasting day.

And now you know why magnesium, if anything, is a building block for everyday life and not an emergency remedy.

If you have migraine: why fasting can be a stronger trigger for you

You know your migraine. You know how the day before feels. Maybe you have learned not to skip any meals because the price was too high. And now you read everywhere how healthy fasting is supposed to be.

The Ramadan study from Beer-Sheva

Human observation A team at the headache clinic of Soroka University Medical Center led by Abu-Salameh had 32 people with migraine keep a migraine diary during Ramadan and the following month. In the fasting month, they counted 9.4 migraine days on average, in the month after, 3.7. Two participants could not continue fasting because of their migraine.

What this means for you: If you have migraine, fasting can be more than a small stumbling block. It deserves its own plan.

Abu-Salameh I et al. J Headache Pain. 2010. DOI: 10.1007/s10194-010-0242-z

A survey across 14 countries paints a similar picture. An existing headache disorder, especially migraine, was more closely linked to headaches during fasting than the lifestyle factors recorded. The attacks came mainly in the afternoon, shortly before breaking the fast, and improved after eating in 54.6 percent of cases.

One observation from migraine research may change how you see this. Premonitory symptoms can begin hours to days before the headache, as a review in Nature Reviews Neurology describes. These include tiredness, yawning, sensitivity to light and noise, thirst and food cravings. So the craving before an attack may already be part of the attack, rather than its trigger.

That can take some weight off your shoulders. Not every hunger followed by a migraine was its trigger. Sometimes the hunger is already the first chapter of the same story.

There is also a trail at the level of messenger substances. In the study from Riyadh, CGRP was elevated in people fasting with headache. Dedicated migraine medications now target CGRP and its receptor, and a review of headache medicine counts them among the major innovations of recent years. Whether such medications make sense around fasting is a question for your neurologist.

Prevention with medication?

Clinical study A research group from Hartford led by Drescher tested a prescription anti-inflammatory drug from the group of COX-2 inhibitors, taken right before the 25-hour fast of Yom Kippur. Headaches occurred in 18.9 percent with the medication and in 65.4 percent with placebo. In a later study during Ramadan, the frequency in the first days was 21 percent with medication and 46 percent with placebo.

What this means for you: Fasting headache seems to be something that can be influenced. This is not a guide to self-treatment, though, because such medications carry their own risks and belong in medical hands.

Drescher MJ, Elstein Y. Headache. 2006. DOI: 10.1111/j.1526-4610.2006.00609.x · Drescher MJ et al. Headache. 2012. DOI: 10.1111/j.1526-4610.2011.01993.x

An over-the-counter extended-release painkiller, by contrast, showed no clear overall effect across the first week of Ramadan in a study from Riyadh. So medication is no substitute for preparation.

If you want to fast with migraine

  • Talk first: Discuss your plans with your doctor, especially if you take preventive medication or have frequent attacks.
  • Start gently: In my view, an eating window such as 12:12 or 14:10 is a more cautious start than 24 hours or more. Full fasting days, as in 5:2, are a better fit for later.
  • Keep your rhythm: Same sleep times, same coffee, no fasting days in particularly stressful weeks. More on this in Intermittent fasting and sleep.
  • Consider your cycle: How your menstrual cycle can help determine the right type of fasting is covered in Fasting for women.
  • Clarify your acute plan: Agree beforehand on what you will take if an attack comes, and whether you will interrupt the fast for it.
Shift in perspective

Cravings before a migraine can already be part of the attack. Then hunger is not your opponent, but a signal to pay attention earlier.

And now you know why fasting with migraine shouldn't be a test of courage, but a planning task.

What is proven, what is plausible and what I observe

With a topic that has so many factors, a clear separation matters to me. Not everything that makes sense has been studied equally well.

Supported by studies

  • Fasting increases the risk of headaches, especially at the beginning.
  • A history of headaches, especially migraine, makes you more susceptible.
  • Sudden caffeine withdrawal can trigger headaches.
  • Preventive medication lowered the frequency in studies.

Plausible, little studied

  • Salt to offset the natriuresis of fasting.
  • A gentle, gradual transition into ketosis.
  • A balanced meal before fasting.
  • Magnesium for the individual fasting day.

What I observe in my practice

  • People who cut back on coffee beforehand often experience the first fasting day as calmer.
  • Headaches come more often when fasting, short nights and stress coincide.
  • A diary often reveals a personal pattern after just a few fasting phases.
  • This is experience, not a study.

A clear head is not a reward for holding out. It is the prerequisite for fasting to feel like freedom rather than a struggle.

Fasting can give you room to breathe: fewer snacks, more calm in your metabolism, more feeling for your body. If every fasting day ends with a headache, that freedom turns into mere deprivation. That is why preparation is worth it.

How you can help prevent headaches during fasting: three levers for your next fasting day

You don't have to change everything at once. These three levers focus on the areas where studies and physiology offer the most clues.

1

Decouple coffee and fasting

Reduce your coffee gradually in the weeks before a longer fast. With intermittent fasting, stick to your usual cup at your usual time if your type of fasting allows it. That way your head doesn't have to carry two withdrawals at once.

2

Plan water and salt in

Drink throughout the day. During longer types of fasting, a small amount of salt can help offset the losses of the first days, provided no heart, kidney or blood pressure condition speaks against it.

3

Increase slowly and keep notes

Start with shorter fasting periods and extend them gradually. Note your last coffee, sleep, fluid intake and when symptoms start. If you have migraine, agree on your acute plan with your doctor beforehand.

When the headache is already there

  • Drink a large glass of water and give yourself some rest, ideally in a quiet, darkened room.
  • During longer types of fasting: a pinch of salt in water or a clear broth, if your type of fasting allows it.
  • If you are used to coffee and your type of fasting allows black coffee, a small cup can soften the withdrawal.
  • If the pain gets worse or nausea, visual disturbances or weakness set in, end the fast. Breaking a fast is not a failure.
Shift in perspective

“It'll pass” is not a plan. A plan means knowing which factors you can adjust beforehand, and knowing when to stop.

And now you know why good preparation can often achieve more during fasting than sheer endurance.

Warning signs: when a headache during fasting needs medical evaluation

Most headaches during fasting are unpleasant but harmless. Some signs, however, suggest that something other than fasting may be behind them.

Please don't wait

Get medical help immediately, if in doubt by calling 112 or your local emergency number

  • A headache that starts suddenly and is the worst of your life
  • Paralysis, numbness, speech problems or confusion
  • Visual disturbances that are new to you and don't fit a known migraine aura

Have it checked by a doctor promptly

  • Headaches with fever
  • New headaches after age 65
  • Headaches during pregnancy or the postpartum period
  • A clearly changed headache pattern or headaches that keep getting worse
  • Headache that does not ease after eating and drinking

These warning signs are based on a review in the journal Neurology that summarizes red flags for so-called secondary headaches. These are headaches caused by another underlying condition.

Diabetes is a special case. If you take insulin or sulfonylureas, fasting can trigger true hypoglycemia, and headache can be one of its signs. In a study from New Zealand in people with type 2 diabetes, the rate of hypoglycemia roughly doubled on fasting days, even though medication had been reduced beforehand. Experts therefore recommend approaching fasting with diabetes under medical supervision and with your own blood sugar monitoring. You can read more in Fasting with type 2 diabetes.

Fasting is also not something to try on your own during pregnancy and breastfeeding, with a current or past eating disorder, or for children and adolescents.

And now you know when a fasting headache is simply unpleasant and when it deserves a medical evaluation.

Frequently asked questions about headaches during fasting and migraine

Is a headache during fasting normal?

It is common, especially at the beginning. In a study from Tel Aviv, 39 percent of people who fasted for 25 hours developed headaches, compared with 7 percent of those who did not fast. In a survey from Riyadh, the figures on the first day of Ramadan were 41 versus 8 percent. Typical is a pressing headache on both sides, often in the forehead area, mild to moderate. But common does not mean harmless in every case: new, unfamiliar or very severe headaches should be checked by a doctor.

How long do headaches during fasting last?

They usually improve as soon as you eat again. According to a review from Parma, fasting headache typically subsides within 72 hours after you resume eating. With repeated fasting, it often becomes less frequent from day to day: in a study from Riyadh, 33 percent of participants had headaches on the first day of Ramadan, and 11 percent on the seventh day. If caffeine withdrawal is behind it, symptoms can last two to nine days, according to a large review.

Why do I get headaches when fasting even though I drink enough?

Because fluids are only one of several factors. In a study from Tel Aviv, women with and without headache lost a similar amount of weight during a 25-hour fast. Dehydration alone did not explain the pain there. Other factors under discussion include caffeine withdrawal, changes in energy metabolism, salt losses via the kidneys, shifted sleep and a predisposition to headaches. People who are already prone to headaches or migraine are affected particularly often.

Can coffee help with headaches during fasting?

If you drink coffee regularly, part of the headache may be caffeine withdrawal. In a double-blind study at Johns Hopkins University, 52 percent of participants developed moderate to severe headaches when their usual caffeine was replaced with placebo without their knowledge. Doctors from Riyadh suggest gradually reducing coffee intake in the weeks before fasting and drinking one more strong coffee right before the fast begins. Whether black coffee fits your type of fasting depends on your goal. You shouldn't drink more than usual, because large amounts are themselves considered a possible migraine trigger.

Can salt help with headaches during fasting?

Possibly, especially with longer types of fasting. In the first days of fasting, the kidneys excrete more sodium. This has been described as the natriuresis of fasting since the 1970s at the latest. If salt and fluids are missing, this can intensify head pressure, dizziness and fatigue. I am not aware of any controlled studies testing salt against fasting headache. In everyday life, less salt was even associated with fewer headaches in a controlled nutrition study with 390 adults. So if you have high blood pressure, heart disease or kidney disease, discuss salt with your doctor beforehand.

Can magnesium prevent headaches during fasting?

There is no direct evidence for that. In a study from Riyadh, blood magnesium levels on the first day of Ramadan did not differ between people with and without fasting headache. For migraine prevention, on the other hand, American professional societies for neurology and headache rate magnesium as probably effective. In a multicenter study led from Munich, attack frequency fell by 41.6 percent with 600 milligrams of magnesium daily and by 15.8 percent with placebo. Magnesium is therefore more of a building block for less migraine overall than a remedy for the individual fasting day.

Can fasting trigger a migraine?

In some people with migraine, fasting can make attacks more likely. In an Israeli study with 32 people with migraine, the number of migraine days was 9.4 in the fasting month of Ramadan and 3.7 in the month after. A survey across 14 countries found that an existing headache disorder, especially migraine, was more closely linked to headaches during fasting than the lifestyle factors recorded. If you have migraine, plan fasting more cautiously and talk to your doctor beforehand.

Can I do intermittent fasting if I have migraine?

That is an individual decision, best made with medical guidance. In my view, a gentle eating window such as 12:12 or 14:10 is a more cautious start for many people with migraine than full fasting days. What matters is regular sleep, consistent coffee intake, enough fluids and a headache diary. In an Italian study with a ketogenic diet, the number of attacks dropped markedly after one month, while symptoms temporarily increased again during the transition back to a normal diet. So changes themselves can be a trigger.

Is a headache during fasting a sign of low blood sugar?

Strictly speaking, rarely. In a large observational study on therapeutic fasting, blood sugar in healthy people dropped on average into the low normal range. The International Classification of Headache Disorders states that fasting headache can also occur without low blood sugar. In an older study, artificially induced low blood sugar triggered migraine-like symptoms in only 2 of 20 people with migraine. It is different if you take glucose-lowering medication: then true hypoglycemia is possible, and fasting belongs under medical supervision.

Is a headache during fasting a sign of detox?

There is no evidence for that. Research discusses other factors: caffeine withdrawal, changes in energy metabolism, fluid and salt balance, sleep and a predisposition to headaches. In a study from Riyadh, people fasting with headache had elevated blood levels of the messenger substance CGRP, which plays a central role in migraine research. So the pain is more a signal from your nervous system than a sign that something is being flushed out right now.

What can I do if the headache has already started during fasting?

First, drink a large glass of water and give yourself some rest. In a case series, headache caused by lack of fluids improved within 30 minutes of drinking in 22 of 34 people. During longer types of fasting, a pinch of salt or a clear broth can be an option, provided your type of fasting allows it. If you are used to coffee and your type of fasting allows black coffee, a small cup can soften the withdrawal. If the pain gets worse or nausea, visual disturbances or weakness set in, end the fast. Breaking a fast is not a failure.

When should I see a doctor about headaches during fasting?

Immediately if the headache starts suddenly and is the worst of your life, or if paralysis, numbness, speech problems or confusion occur. In that case, call 112 or your local emergency number. You should also have the following checked by a doctor: headaches with fever, new headaches after age 65, headaches during pregnancy or the postpartum period, and a clearly changed headache pattern. If you take insulin or sulfonylureas, discuss any fast beforehand, because fasting can make hypoglycemia more likely.

Whether fasting has anything to do with detoxification at all is covered in Fasting as detox: autophagy instead of slag.

Where this topic touches other areas

Headaches during fasting touch your nervous system, metabolism, fluid balance and daily rhythm. If you want to dig deeper, these neighboring topics from other guides are worth a look.

SJ

Shukri Jarmoukli

Physician, Integrative Medicine · ViveCura Berlin

I am a licensed physician and work in my private practice in Berlin at the intersection of conventional medicine, Clinical Psychoneuroimmunology and lifestyle medicine. Fasting, metabolism and the nervous system are among my areas of focus.

What I write here is one perspective among several possible ones. I deliberately separate what studies support well, what is mechanistically plausible and what is my personal assessment. This text does not replace a medical examination or consultation.

ViveCura, Privatpraxis Shukri Jarmoukli, Skalitzer Straße 137, Berlin

Sources

All studies were checked via PubMed for authors, year, journal and DOI. I additionally cross-checked key papers via Consensus and resolved their DOIs. The study type is given in square brackets so that you can judge the strength of the evidence yourself.

  1. Mosek A, Korczyn AD. Yom Kippur headache. Neurology. 1995;45(11):1953-5. DOI: 10.1212/wnl.45.11.1953 [Real-world, survey before and after fasting, n=370, of whom 211 fasted]
  2. Mosek A, Korczyn AD. Fasting headache, weight loss, and dehydration. Headache. 1999;39(3):225-7. DOI: 10.1046/j.1526-4610.1999.3903225.x [Pathophysiology, observational study, n=56 women]
  3. Awada A, al Jumah M. The first-of-Ramadan headache. Headache. 1999;39(7):490-3. DOI: 10.1046/j.1526-4610.1999.3907490.x [Real-world, cross-sectional survey, n=116]
  4. Torelli P, Evangelista A, Bini A, Castellini P, Lambru G, Manzoni GC. Fasting headache: a review of the literature and new hypotheses. Headache. 2009;49(5):744-52. DOI: 10.1111/j.1526-4610.2009.01390.x [Review]
  5. Torelli P, Manzoni GC. Fasting headache. Curr Pain Headache Rep. 2010;14(4):284-91. DOI: 10.1007/s11916-010-0119-5 [Review]
  6. Headache Classification Committee of the International Headache Society (IHS). The International Classification of Headache Disorders, 3rd edition. Cephalalgia. 2018;38(1):1-211. DOI: 10.1177/0333102417738202 [Official document, international classification of headache disorders]
  7. Makki G, Do TP, Pellesi L. Fasting-induced headache in Ramadan: a scoping review with implications for clinical practice. Pain Manag. 2026:1-11. DOI: 10.1080/17581869.2026.2744716 [Review, scoping review, 20 studies]
  8. Ceren Akgor M, Saghır K, Can AI, Sahbaz FG, Özcelik EU, Atalar AC, et al. Primary headache disorders susceptibility is associated with fasting-related headache: evidence from a multinational study across 14 countries. Front Neurol. 2026;17:1859536. DOI: 10.3389/fneur.2026.1859536 [Real-world, cross-sectional survey in 14 countries]
  9. Abu-Salameh I, Plakht Y, Ifergane G. Migraine exacerbation during Ramadan fasting. J Headache Pain. 2010;11(6):513-7. DOI: 10.1007/s10194-010-0242-z [Real-world, cohort study with crossover comparison, n=32]
  10. Alwhaibi A, Alasmari F, Almutairi F, Assiri MA, Aldawsari FS, Aloyayd ST, et al. Effect of fasting-induced headache on calcitonin gene related peptide (CGRP) and other clinical biomarkers on the first day of Ramadan: Sub-analysis from a randomized open label clinical trial. J Headache Pain. 2024;25(1):181. DOI: 10.1186/s10194-024-01886-0 [RCT, sub-analysis with biomarkers, n=61]
  11. Almohammed OA, Alsanea S, Albishi N, AlMuhareb L, AlMotawa R, Alrasheed S, et al. Evaluating the use of paracetamol to prevent fasting headache during the first week of Ramadan: A randomized, open-label, clinical trial. Headache. 2024;64(10):1285-1297. DOI: 10.1111/head.14828 [RCT, open-label, n=173 analyzed]
  12. Drescher MJ, Elstein Y. Prophylactic COX 2 inhibitor: an end to the Yom Kippur headache. Headache. 2006;46(10):1487-91. DOI: 10.1111/j.1526-4610.2006.00609.x [RCT, double-blind, n=105]
  13. Drescher MJ, Wimpfheimer Z, Abu Khalef S, Gammaitoni A, Shehadeh N, Torgovicky R. Prophylactic etoricoxib is effective in preventing “first of Ramadan” headache: a placebo-controlled double-blind and randomized trial of prophylactic etoricoxib for ritual fasting headache. Headache. 2012;52(4):573-81. DOI: 10.1111/j.1526-4610.2011.01993.x [RCT, double-blind, crossover, n=189 analyzed]
  14. Silverman K, Evans SM, Strain EC, Griffiths RR. Withdrawal syndrome after the double-blind cessation of caffeine consumption. N Engl J Med. 1992;327(16):1109-14. DOI: 10.1056/NEJM199210153271601 [Pathophysiology, controlled clinical study, double-blind, n=62]
  15. Juliano LM, Griffiths RR. A critical review of caffeine withdrawal: empirical validation of symptoms and signs, incidence, severity, and associated features. Psychopharmacology (Berl). 2004;176(1):1-29. DOI: 10.1007/s00213-004-2000-x [Systematic review, 57 experimental and 9 survey studies]
  16. Alstadhaug KB, Ofte HK, Müller KI, Andreou AP. Sudden Caffeine Withdrawal Triggers Migraine: A Randomized Controlled Trial. Front Neurol. 2020;11:1002. DOI: 10.3389/fneur.2020.01002 [RCT, double-blind, crossover, stopped early, n=9 evaluable]
  17. Mostofsky E, Mittleman MA, Buettner C, Li W, Bertisch SM. Prospective Cohort Study of Caffeinated Beverage Intake as a Potential Trigger of Headaches among Migraineurs. Am J Med. 2019;132(8):984-991. DOI: 10.1016/j.amjmed.2019.02.015 [Real-world, prospective cohort with diary, n=98]
  18. Pearce J. Insulin induced hypoglycaemia in migraine. J Neurol Neurosurg Psychiatry. 1971;34(2):154-6. DOI: 10.1136/jnnp.34.2.154 [Pathophysiology, provocation study, n=20 with migraine and a control group]
  19. Wilhelmi de Toledo F, Grundler F, Bergouignan A, Drinda S, Michalsen A. Safety, health improvement and well-being during a 4 to 21-day fasting period in an observational study including 1422 subjects. PLoS One. 2019;14(1):e0209353. DOI: 10.1371/journal.pone.0209353 [Real-world, prospective observational study, n=1,422]
  20. Gross EC, Lisicki M, Fischer D, Sándor PS, Schoenen J. The metabolic face of migraine: from pathophysiology to treatment. Nat Rev Neurol. 2019;15(11):627-643. DOI: 10.1038/s41582-019-0255-4 [Mechanistic review]
  21. Martins-Oliveira M, Akerman S, Holland PR, Hoffmann JR, Tavares I, Goadsby PJ. Neuroendocrine signaling modulates specific neural networks relevant to migraine. Neurobiol Dis. 2017;101:16-26. DOI: 10.1016/j.nbd.2017.01.005 [In vivo, rat]
  22. Bostock ECS, Kirkby KC, Taylor BV, Hawrelak JA. Consumer Reports of “Keto Flu” Associated With the Ketogenic Diet. Front Nutr. 2020;7:20. DOI: 10.3389/fnut.2020.00020 [Real-world, analysis of forum reports, 300 users]
  23. Di Lorenzo C, Coppola G, Sirianni G, Di Lorenzo G, Bracaglia M, Di Lenola D, et al. Migraine improvement during short lasting ketogenesis: a proof-of-concept study. Eur J Neurol. 2015;22(1):170-7. DOI: 10.1111/ene.12550 [Real-world, prospective observational study, n=96 women with overweight and migraine]
  24. Spark RF, Arky RA, Boulter PR, Saudek CD, O'Brian JT. Renin, aldosterone and glucagon in the natriuresis of fasting. N Engl J Med. 1975;292(25):1335-40. DOI: 10.1056/NEJM197506192922506 [Pathophysiology, paper on the natriuresis of fasting]
  25. Blau JN, Kell CA, Sperling JM. Water-deprivation headache: a new headache with two variants. Headache. 2004;44(1):79-83. DOI: 10.1111/j.1526-4610.2004.04014.x [Case series, n=34]
  26. Spigt M, Weerkamp N, Troost J, van Schayck CP, Knottnerus JA. A randomized trial on the effects of regular water intake in patients with recurrent headaches. Fam Pract. 2012;29(4):370-5. DOI: 10.1093/fampra/cmr112 [RCT, n=102, 3 months]
  27. Pogoda JM, Gross NB, Arakaki X, Fonteh AN, Cowan RP, Harrington MG. Severe Headache or Migraine History is Inversely Correlated With Dietary Sodium Intake: NHANES 1999-2004. Headache. 2016;56(4):688-98. DOI: 10.1111/head.12792 [Real-world, cross-sectional study, n=8,819]
  28. Amer M, Woodward M, Appel LJ. Effects of dietary sodium and the DASH diet on the occurrence of headaches: results from randomised multicentre DASH-Sodium clinical trial. BMJ Open. 2014;4(12):e006671. DOI: 10.1136/bmjopen-2014-006671 [RCT, post hoc analysis, n=390]
  29. Holland S, Silberstein SD, Freitag F, Dodick DW, Argoff C, Ashman E. Evidence-based guideline update: NSAIDs and other complementary treatments for episodic migraine prevention in adults. Neurology. 2012;78(17):1346-53. DOI: 10.1212/WNL.0b013e3182535d0c [Systematic review, evidence-based guideline of the American Academy of Neurology and the American Headache Society]
  30. Peikert A, Wilimzig C, Köhne-Volland R. Prophylaxis of migraine with oral magnesium: results from a prospective, multi-center, placebo-controlled and double-blind randomized study. Cephalalgia. 1996;16(4):257-63. DOI: 10.1046/j.1468-2982.1996.1604257.x [RCT, double-blind, multicenter, n=81]
  31. Karsan N, Goadsby PJ. Biological insights from the premonitory symptoms of migraine. Nat Rev Neurol. 2018;14(12):699-710. DOI: 10.1038/s41582-018-0098-4 [Mechanistic review]
  32. Goadsby PJ. Primary headache disorders: Five new things. Neurol Clin Pract. 2019;9(3):233-240. DOI: 10.1212/CPJ.0000000000000654 [Review]
  33. Do TP, Remmers A, Schytz HW, Schankin C, Nelson SE, Obermann M, et al. Red and orange flags for secondary headaches in clinical practice: SNNOOP10 list. Neurology. 2019;92(3):134-144. DOI: 10.1212/WNL.0000000000006697 [Review]
  34. Corley BT, Carroll RW, Hall RM, Weatherall M, Parry-Strong A, Krebs JD. Intermittent fasting in Type 2 diabetes mellitus and the risk of hypoglycaemia: a randomized controlled trial. Diabet Med. 2018;35(5):588-594. DOI: 10.1111/dme.13595 [RCT, n=41 adults with type 2 diabetes, 12 weeks]
  35. Grajower MM, Horne BD. Clinical Management of Intermittent Fasting in Patients with Diabetes Mellitus. Nutrients. 2019;11(4):873. DOI: 10.3390/nu11040873 [Review, expert-based recommendations]
For context: Many studies on fasting headache come from religious fasting on Yom Kippur and during Ramadan, when people also do not drink. This can only partly be transferred to intermittent fasting with water. Most of the studies are surveys or smaller studies. There are no controlled studies on salt as a countermeasure, and the role of hunger hormones for pain pathways so far comes mainly from animal models. This article reflects a physician's perspective and does not replace an individual examination or consultation.

Have questions or want to book an appointment?

We'd be happy to advise you personally at our practice.

Book appointment