Why electrolytes matter on a ketogenic diet
Electrolytes are one of the main things that decide whether the first week of keto feels fine or rough. When carbohydrate intake drops, insulin falls. Insulin normally helps the kidneys hold on to sodium, so with less of it, more sodium leaves in the urine, and water goes with it.
That loss of sodium and fluid can bring headaches, tiredness, lightheadedness on standing, and cramps. Potassium and magnesium matter too: potassium losses can rise alongside sodium, and many people fall short of magnesium on any diet.
Much of this can be eased by getting enough sodium, potassium, and magnesium from the start. This calculator gives targets as total daily intake (food, broth, salt, and any supplement combined), adjusted for your phase, activity, sweat, and symptoms. It is a starting point, not a prescription.
Check with your clinician first if you have high blood pressure, heart failure, or kidney disease, or take diuretics, ACE inhibitors, ARBs, or potassium-sparing drugs. For you, the right sodium and potassium intake may be quite different, and your clinician should set it.
Sodium, potassium, and magnesium on keto
Sodium: the foundation
Sodium is the electrolyte most people underestimate on keto. The general guideline for adults is no more than 2,300 mg a day, but on a ketogenic diet a common range is 3,000 to 5,000 mg a day in total, because of the extra sodium the kidneys excrete when insulin is low. A teaspoon of table salt contains about 2,300 mg of sodium. A cup of broth adds several hundred milligrams or more, depending on the brand. Cured meats, olives, and pickles contribute too.
Potassium: food first
This calculator targets 3,000 to 4,700 mg of potassium a day in total and never sets it below the NIH Adequate Intake (2,600 mg for women, 3,400 mg for men). Most of it should come from food. In the US, over-the-counter potassium supplements usually contain no more than 99 mg per pill, so food does the heavy lifting. Good keto sources include avocado (about 700 mg in a medium Hass avocado), cooked spinach (about 840 mg per cup), salmon (several hundred milligrams per fillet), mushrooms, and broccoli. The calculator asks for your sex so it never sets potassium below the Adequate Intake for you. If you have kidney disease or take ACE inhibitors, ARBs, or potassium-sparing diuretics, do not raise potassium without medical advice.
Magnesium: often short
Many adults do not get the recommended amount of magnesium from food, on any diet. Total magnesium of about 300 to 500 mg a day is the range used here, with supplemental magnesium kept at or below 350 mg a day (the NIH upper limit) unless a clinician advises otherwise. Good food sources include pumpkin seeds (about 150 mg per ounce), cooked spinach (about 150 mg per cup), almonds (about 80 mg per ounce), and dark chocolate. Magnesium glycinate is a popular supplement form because it tends to be gentle on the stomach. People with kidney disease should not take magnesium supplements without medical advice.
When to use electrolyte supplements
Food and salt should be the foundation. Supplements can help in specific situations: endurance athletes and heavy sweaters who lose a lot of sodium, people in hot climates or physical jobs, and anyone who struggles to reach magnesium from food. If you use one, choose a product without sugar or maltodextrin and check its sodium, potassium, and magnesium per serving against your targets from this calculator.
Keto flu symptoms and what they may point to
Symptoms overlap and are not a diagnosis, but some patterns are common enough to be a useful first guess. That is why the calculator nudges targets based on the symptoms you select:
- ▸Headaches are often linked to low sodium and fluid in the first days of keto. A cup of broth or a pinch of salt in water helps many people.
- ▸Muscle cramps are commonly blamed on low magnesium or potassium, though the evidence for any single cause is mixed. Night-time calf cramps are a common complaint. Check sodium too, and consider magnesium within the supplement limit.
- ▸Heart palpitations can have several causes, including too much potassium as well as too little. Get them checked rather than adjusting electrolytes on your own, and seek urgent care if they come with chest pain, fainting, or breathlessness.
- ▸Fatigue and brain fog are common in the first several days while the body shifts toward using fat and ketones. If they persist beyond a week or so, low sodium, low magnesium, or eating too little overall are worth checking.
- ▸Dizziness and lightheadedness especially on standing up quickly, often reflects lower blood pressure from sodium and fluid loss. If you take blood pressure medication, tell your doctor, as your dose may need reviewing.
Electrolyte needs as you adapt
The first two to four weeks are usually the most demanding, because that is when fluid and sodium shifts are largest and symptoms most common. The extra sodium loss continues for as long as carbohydrate stays low, so needs stay above the general guideline, but most people find that steady habits around salt, broth, and potassium-rich food make it easy to manage later on.
That is why the calculator asks for your phase and adjusts your targets within the ranges above. Your symptoms are the best guide. If you feel well, there is no need to push intake higher.