Why the Keto Headache Happens & How to Stop It

by | Last updated: Aug 16, 2020 at 4:00PM | - Published on: Nov 21, 2019

Going keto means getting into a deeper state of fat burning, which requires a short adaptation phase. Headaches can be a mild symptom of that and are easily dealt with by upping your electrolytes (salt, potassium, magnesium). There can be other reasons for headaches, but when they coincide with going keto the electrolyte story is by far your best bet.

Nutrita Pro

Achieve faster ketosis choosing the right nutrition with Nutrita Pro

Headaches happen to even the best of us and sometimes it’s hard to determine why we get them. Whether it’s stress, food intolerances, injury or trauma, they can come on rapidly and sometimes without explanation.

But when it comes to getting a headache on keto, there might be something behind it. And as much as it may downright suck, don’t let it discourage you from continuing your keto journey.

What is the keto (or low-carb) headache?

The keto headache is essentially one of the symptoms associated with the keto flu. If you’re not too sure what the keto flu is, check out our post, What’s the Keto Flu and How to Cure It for more details.

When first transitioning to keto, the body undergoes a major shift in its fuel source from carbohydrates to mostly fats. Depending on your consumption of carbs and the degree of insulin resistance prior to making this switch, the symptoms you experience may be more or less severe. As your body becomes accustomed to using fats for energy as opposed to carbohydrates, you may experience some flu-like symptoms — a headache being one of them.

This is what we called the keto headache.

The changes that the body is undergoing during the transition into keto generally cause a range of symptoms termed the keto flu, with the three main ones being:

A headache — More often than not, this kind of headache will be dull, nagging one that may cause you discomfort, outright pain, and even blurred vision. If it’s sufficiently severe it may be an actual migraine.

Mental or brain fog — If you’re unable to think clearly and focus, chances are you’re experiencing brain fog. Your mind may feel a little bit fuzzy and your memory may not be as sharp as usual.

Fatigue — This kind of fatigue isn’t just mental, but physical. Simple tasks you do on a daily basis, like. walking to work, maybe exhausting.

These are a few of the main symptoms that appear when we start keto, but because the body is undergoing a pretty hefty shift, it’s not just the head that’s an effect, but rather the entire body.

Why does the keto headache happen?

There are three main reasons why we get the keto headache:

1. Carb or sugar withdrawal

When the body is used to relying on carbs to fuel itself and you deprive it of that, it may become a little ‘confused’ so to speak.

When we cut caffeine from the diet, one of the most common side effects we experience is a headache. This is because eliminating caffeine causes the blood vessels in the brain to constrict[1], thus reducing blood flow which may well be the source of pain. This sudden change in blood flow can cause pain, hence we experience a headache. As the brain adjusts to reduced blood flow, the headache will subside.

The same premise can be applied to removing carbs from the diet. Animal studies[2] have found that sugar withdrawal produces much of the same effects as drugs. As well, in both human and animal studies, evidence suggests a substantial overlap between the effects of drugs and sugar with respect to brain neurochemistry and behavior [3].

Fluctuating blood glucose levels may also be contributing to the onset of a headache. Studies[4] have shown a nearly 3-fold risk in severe headaches with imbalanced glucose. They may cause headaches through the elevation of the stress hormones adrenalin and noradrenalin, which can cause the blood vessels in the brain to constrict, thereby reducing oxygen availability to the brain and causing pain. Once glucose levels become stable through nutritional ketosis, the headaches should subside.

Overwhelmed Hypothalamus

The hypothalamus, while not a large gland, controls virtually every function in the body, hence why it’s given the name the ‘master gland’. It controls circadian rhythm (sleep-wake cycle), the reproductive and endocrine pathways, and energy metabolism, which includes hunger, temperature regulation, and regulation of fluid balance. It integrates functions from the endocrine system, the autonomic nervous system (sympathetic and parasympathetic), and other systems to maintain homeostasis. Certain homeostatic changes within the body may be a trigger[5] for the onset of headaches, which can come in the form of dietary changes, hormonal fluctuations, stress, or disrupted sleep.

Evidence suggests that activation of the hypothalamus increases significantly during both chronic and acute migraines. A study[6] published in Neurology showed that hypothalamic activity increases in response to painful stimuli originating from the trigeminal nerve that occurs during the onset of headaches and migraines. Investigators think that the hypothalamus mediates this activity and thus precipitates migraines.

Circadian rhythm disruption

As mentioned, the hypothalamus has a role that’ analogous to a control center for our body. It regulates nearly every body function, including sleep and your circadian rhythm. Think of the latter as the timing of your biological processes with the outside world. Studies[7] have shown that levels of sleep hormones are associated with the onset of headaches and migraines. In patients experiencing migraines, melatonin suppression was more pronounced, as well as a variety of night‐time changes in melatonin levels, which included decreased nocturnal melatonin, decreased melatonin during REM sleep, and delayed nocturnal melatonin peak.

What does this have to with the ketogenic diet? Well, when transitioning to a keto diet your metabolism has to adapt to more fat burning and less glucose burning. For some people, this manifests in difficulty sleeping which is disruptive to the body’s circadian rhythms. So it’s not the ketogenic diet per se causing the headache, but rather the disrupting adaptation phase following the withdrawal of junky carbohydrates and high omega-6 seed oils. Indeed, evidence[8] suggests that the brain of migraineurs is incredibly sensitive to homeostatic deviations, making it plausible that the adaptation phase to the ketogenic may be a temporary homeostatic disturbance.

Metabolic inflexibility

The more metabolically inflexible one is, defined as the ability to seamlessly switch between burning fat and burning glucose, bouts of hypoglycemia and hyperglycemia are more likely to occur. In the case of hypoglycemia, circulating blood glucose is too low to support energy demands. This result is changing levels of hormones, namely epinephrine and norepinephrine, which can in turn cause alterations within the brain. For instance, blood vessels may constrict leading to a feeling of pain and discomfort. To avoid entering a hypoglycemic state[9], tissues (cardiac, skeletal muscle, and liver), it’s crucial that you train your body to burn fat so that it can rely on that as its primary source and avoid hypoglycemic episodes. Ketogenic diets are a great way to do that, as well as fasting and exercise (especially HIIT training).

Interestingly, some studies are now investigating the use of ketogenic diets to treat migraines! This one[10] for instance, compared healthy volunteers to people before and after a month of being on a ketogenic diet. The keto group had fewer migraines, when they happened they didn’t last as long and their reported disability from them was lessened. These benefits were further supported by neurophysiological measures.

2. Dehydration

For every one gram of glycogen stored in the body, 3-4 grams of water are stored alongside it. Glycogen is the storage form of carbs. As glycogen stores become depleted (i.e. they get burned), the water stored with it gets released. This is why we initially experience such a drastic weight loss when first transitioning to keto, as much of it the glycogen gets used up before we can more fully access our fat stores.

As we start to restrict carbohydrate intake, the body rapidly releases water (known as the diuretic effect) which may lead to a slight state of dehydration in some individuals.

The reason why we experience headaches or migraines[11] when we’re dehydrated is due to changes in brain volume. When the body is dehydrated, the change in osmolarity (fluid movement) in the cells induces volume changes, which ultimately affects the cerebral cortex, white matter, and hypothalamus/thalamus[12].

This loss of water may also come to the loss of some minerals and electrolytes, which brings us to the next point.

3. Electrolyte imbalance

When water is released from the body, important electrolytes such as sodium, potassium, and magnesium are also released, which can lead to imbalances within the body.

Because electrolytes contribute to nervous system function as well as fluid balance within the body, imbalances can lead to a variety of unpleasant symptoms — a headache being one of them. Supplementing with one of the main electrolytes, magnesium[13], has been shown to be potentially beneficial in reducing the severity of acute-onset migraines.

Additionally, studies have shown that sodium deprivation, another major electrolyte, may overstimulate pain receptors in the brain, which may make the slight headache you experience feel significantly worse. Prior to the onset of a migraine, there can be a disruption in electrolyte homeostasis[14] which is thought to cause a generalized state of overstimulation in the brain. When getting into ketosis, sodium levels generally decrease the most of any of the electrolytes. Bone broth is a tasty remedy to that. Not only is it full of collagen – which has a reasonable chance[15] of helping people with cartilage and joint issues – but it’s also rich in minerals like sodium and potassium. If your headache is due to a lack of electrolytes, then it really could help!

If you’re curious about more ways to replenish your electrolytes, check out our article on electrolytes here.

4. Caffeine withdrawal

If you’re doing a drastic overhaul on your diet and removing certain elements (grains, processed sugar, fruit, dairy, etc.), caffeine may be something you want to consider removing, or experimenting with how much you drink and when you have it. Many people rely on caffeine to get through the day, but since following a ketogenic diet should stabilize your energy levels, caffeine may feel much less ‘necessary’. If cutting out caffeine is something you’ve decided to do while transitioning to keto, you should know that it can come with its own set of unpleasant withdrawal symptoms.

While keto doesn’t eliminate caffeine, this believed drug is a true stimulant that affects the central nervous system (CNS). It binds to dopamine[16], an important neurotransmitter involved in the pleasure and reward system. And although caffeine does work on the dopamine pathway, it’s major effects are elicited by blocking adenosine, another neurotransmitter that helps you feel sleepy at the end of the day. In doing so, caffeine’s stimulatory and awakening effects are elicited.

Many people use caffeine for its stimulatory effects, but it’s also been shown[17] to increase metabolic rate and promote fat usage — two factors that are also associated with being in a state of ketosis.

On the other hand, some short-term studies have shown that in some individuals caffeine may have an effect on morning blood sugars[18] and insulin levels after a meal[19]. This is likely due to the release of epinephrine[20] (a ‘stress’ hormone). This may be a reason for reducing, or eliminating coffee when first starting out on a ketogenic diet. This isn’t to scare you away from coffee over the long-term, but just to let you know that it could account for some unsatisfactory changes in blood sugars. One study[21] showed that in individuals with diabetes, consumption of caffeine increased blood glucose by 16-28% and insulin by 19-48%, as well as decreasing insulin sensitivity by 14-37%. Another study[22] conducted in individuals with type II diabetes showed that caffeinated coffee ingestion along with a high glycemic meal reduced insulin sensitivity by 40%, and coffee consumption along with a low glycemic meal still resulted in a 29% decrease in insulin sensitivity.

As such, cutting out caffeine cold turkey can cause some unpleasant side effects, the first generally being a wicked “caffeine-withdrawal” headache[23]. A headache is experienced because caffeine causes a reduction in cerebral blood flow due to constriction of blood vessels[24]. When caffeine intake is reduced, vessels dilate, which causes a drastic change in blood flow and can result in painful withdrawal headaches. Other symptoms like difficulty concentrating, mood disturbances, mild nausea, and general flu-like feelings may be experienced also.

How long does it last?

The keto headache is transient. It isn’t something that will last for the entire duration you’re keto. For most people, it only lasts about 24 hours to a week or so at most. Anecdotally, it’s commonly reported that the average duration is around 2 to 5 days, with some stating that it may last up to two weeks.

Generally, the severity of the headache will depend on your level of carb consumption and degree of metabolic inflexibility prior to entering ketosis. For example, if an individual has been following a relatively low carb diet before going keto, the extent to which they experience any symptoms of the keto flu will likely be less than for someone who was following a high carb diet prior to going keto. In this case, the headache may be minimal or non-existent.

Below, we provide a few methods to get rid of the keto headache and prevent it from occurring.

If the headache persists beyond a reasonable time period, consult a medical professional to discuss other possible causes and treatment options.

How to get rid of the keto headache

When you feel a headache coming on, your initial reaction is probably to stop it in its tracks. While it’s not guaranteed, there are a few things we can suggest for keto headache relief:

1. Add salt to the water

Sodium loss through urine is one of the main causes of a headache on keto. Ensuring sufficient sodium levels may prevent you from experiencing it. Adding a ½ to 1 teaspoon of salt to a glass of warm water will help to relieve the pressure.

If you find this amount works, continue with it for a few days until the headache has completely subsided.

2. Increase your fat intake (especially animal omega-3s) if you’re too low calorie/low-fat

On a keto diet, 60 to 80% of your caloric intake will be coming from fat, depending on a few variables like age, sex, activity levels, and your goals (e.g. fat loss, weight maintenance, build muscle, etc.). Going to low-calorie by ditching fat all too common and a recipe for strong cravings, feeling fatigued, and even getting headaches.

Maybe you could do with a little more anti-inflammatory fats from foods like sardines and salmon. They contain lots of long-chain omega-3 fats. Indeed, these fats have plausible[25] ways they may help lessen headaches. It’s worth a try!

Your body makes ketone bodies from fat. These ketones can dampen inflammation[26] which is commonly associated with headaches and migraines, as well as modulate cortical excitability (which you can think of as the firing rate of brain cells).

If you’re just starting out keto and aren’t sure of the best sources of fats to consume, take a look at our Ultimate Keto Diet Guide for some guidance on what’s good to eat.

How to prevent the keto headache

When it comes to treating and preventing the keto headache, the recommendations are essentially the same — if you can put these practices into place, you can avoid experiencing the keto headache and if by chance it happens, you’ll know what to do.

1. Stay hydrated. Ensuring proper hydration is number one to preventing the onset of a headache. After all, water is essential for every function in the body. However, this doesn’t mean you should be constantly sipping on a water bottle. People commonly get headaches when sitting around in an air-conditioned office or airplane that dries out the room. Remarkably though, cyclists performing a 40km time-trial[27] see no decrements in performance when simply drinking to thirst. The lesson here is to be mindful of your environment and drink to thirst. Drinking to thirst is easier if you’re not drinking sugary drinks like fruit juices and sodas.

2. Ensure your electrolyte levels are adequate. Re-establishing electrolyte homeostasis, namely sodium and potassium, has been shown to help prevent the onset of migraines. Sodium and potassium are responsible for maintaining fluid balance in the body, so imbalanced minerals can contribute to dehydration. Coconut water, in moderation, makes for a great hydration method while also replenishing important electrolytes like sodium, magnesium, and potassium.

3. Increase your magnesium. Magnesium[28] is a known muscle relaxant due to its ability to compete with calcium to prevent muscle contraction and cramps, which can help to prevent tension headaches. Studies[29] show that individuals suffering from migraines have low brain magnesium, so ensuring adequate magnesium intake may be a preventative measure. Magnesium is also an important electrolyte and imbalances can also lead to the onset of headaches and migraines.

4. Transition slowly. The first week of your keto journey is when you’re most likely to experience the highest number of unpleasant symptoms that are associated with going keto. Making the transition slower, i.e. slowly reducing the number of carbs you consume rather than going straight to 25 g of total carbs,, may help to relieve some of the unpleasant symptoms you experience.


The keto headache is something that few will experience. Nevertheless, it’s good to know it can happen and why it happens so that if it does, you don’t think you’ve failed the diet. No, most likely, your body is reacting strongly to the removal of addictive junk carbs and high omega-6 seed oils. Depending on the extent of carb withdrawal you are going through, the severity of the keto headache and/or keto flu symptoms you experience may vary. If it happens, however, don’t panic and avoid taking painkillers to decrease the pain and talk to your doctor first if you’re thinking about it. Implement the tips we have provided for you to reduce the symptoms so you can get back to your routine, and if that doesn’t help, speak to your medical doctor.

Written by Raphael Sirtoli, MSc Biology

Raphael is self-learner and self-experimenter. A decade before starting on his scientific path he started adopting various low-carb diets and many new lifestyle practices, such as cold exposure, meditation, barefoot running and Wim Hof breathwork.

Nutrita Pro

Achieve faster ketosis choosing the right nutrition with Nutrita Pro

Stay Updated

We'll send you updates everytime a new high-quality post is published.

You can unsubscribe at any time. Read our privacy policy.

Customer reviews

Contact us at hello@nutrita.app • Copyright © Nutrita.


The Service offers health, fitness and nutritional information and is designed for educational purposes only. You should not rely on this information as a substitute for, nor does it replace, professional medical advice, diagnosis, or treatment. If you have any concerns or questions about your health, you should always consult with a physician or other health-care professional. Do not disregard, avoid or delay obtaining medical or health related advice from your health-care professional because of something you may have read on the Service. The use of any information provided on the Service is solely at your own risk.