Free Keto Tool

Keto Electrolyte Calculator

Get daily sodium, potassium, and magnesium targets for a ketogenic diet, as total intake from food, broth, salt, and any supplement. This free electrolyte calculator adjusts for your keto phase, activity level, sweat level, and current symptoms. No signup required.

By MeKeto Editorial · Last updated October 2026

Sex

Potassium and magnesium needs differ by sex.

Body weight

lbs

Keto phase

Activity level

Sweat level

Current symptoms (optional)

Select any symptoms you are currently experiencing

The list starts here

MeKeto has no newsletter yet. Nothing has been sent, so there is no archive to catch up on. Leave your address and you are on the list from the first message, whenever new calculators and keto guides are worth writing up.

We store your address and where on the site you signed up. The privacy policy has the details. Ask to be removed at any time at privacy@meketo.com.

How to use this calculator

01

Enter your sex, weight, and keto phase

Tell us your sex, body weight, and whether you are still adapting (first 4 weeks) or fat-adapted (1+ month on keto). Sex sets your potassium floor.

02

Select activity and sweat level

How active you are and how much you sweat change how much sodium and potassium you lose each day.

03

Add symptoms (optional)

If you have keto flu symptoms, select them. Your targets are adjusted for the electrolyte most often linked to each symptom.

Related calculators

Keep learning

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.

Frequently asked questions

When carbohydrate intake drops, insulin falls, and lower insulin makes the kidneys excrete more sodium. Water follows the sodium, and potassium losses can rise too. That loss is behind much of the "keto flu": headache, tiredness, lightheadedness, and cramps in the first week or two. Getting enough sodium, potassium, and magnesium helps many people avoid or ease it.

A common range on a well-formulated ketogenic diet is 3,000 to 5,000 mg of sodium a day in total, from food, broth, and salt combined; fat-adapted people often sit toward the lower end. That is more than the general 2,300 mg guideline because of the extra sodium lost through the kidneys on keto. Heavy sweaters and very active people tend to need the upper end. If you have high blood pressure, heart failure, or kidney disease, or take diuretics, ACE inhibitors, ARBs, or potassium-sparing drugs, set your sodium with your clinician.

Keto flu is a set of symptoms (headache, tiredness, brain fog, irritability, cramps, nausea) that often appears in the first few days of cutting carbohydrate. Low sodium and fluid are a big part of it. Salting food more generously or drinking a cup or two of broth, eating potassium-rich foods such as avocado and leafy greens, and getting enough magnesium help most people. Symptoms usually ease within a week or two.

Sodium, usually yes: salting food and drinking broth covers it. Potassium, mostly: avocado, leafy greens, salmon, and mushrooms are good keto sources, and food should supply most of it. Magnesium is harder to reach from food alone, so some people add a supplement. Aim for 300 to 500 mg total, and keep supplemental magnesium at or below 350 mg a day (the NIH upper limit) unless a clinician advises otherwise.

Food is the better route for most people. The target here is 3,000 to 4,700 mg total a day, mostly from food, and never below the NIH Adequate Intake (2,600 mg for women, 3,400 mg for men). Over-the-counter potassium supplements in the US usually contain no more than 99 mg per pill, so they make little difference. Do not take potassium supplements or salt substitutes without medical advice if you have kidney disease, or take ACE inhibitors, ARBs, or potassium-sparing diuretics, because potassium can build up to dangerous levels.

Magnesium glycinate and magnesium citrate are well absorbed and commonly used; glycinate tends to be gentler on the stomach, while citrate and oxide are more likely to loosen stools. Total magnesium from food and supplements is typically 300 to 500 mg a day. Keep supplemental magnesium at or below 350 mg a day, the NIH upper limit for adults, unless a clinician advises otherwise; a supplement of about 200 to 350 mg on top of food is a common choice. People with kidney disease should not take magnesium supplements without medical advice.

For as long as you eat a ketogenic diet. The extra sodium loss is tied to low insulin, so it continues rather than being a one-off adjustment, though fat-adapted people often sit toward the lower end of the 3,000 to 5,000 mg sodium range. Many people find that by a few weeks in, with steady habits around salt and food, they no longer need to think about it much.

Many sports drinks contain a lot of sugar and can stop ketosis. Look for electrolyte products with no sugar and no maltodextrin, and check the label: some products sold as "electrolyte" drinks contain only small amounts of sodium. Compare the sodium, potassium, and magnesium per serving with your targets from this calculator.

Sources

  1. Phinney SD, Volek JS. The Art and Science of Low Carbohydrate Living. Beyond Obesity LLC, 2011. Protein, sodium and electrolyte guidance for a well-formulated ketogenic diet.
  2. Virta Health. Managing Potassium and Sodium as Part of a Well-Formulated Ketogenic Diet. Link
  3. National Institutes of Health, Office of Dietary Supplements. Potassium Fact Sheet for Health Professionals. Link
  4. National Institutes of Health, Office of Dietary Supplements. Magnesium Fact Sheet for Health Professionals. Link
  5. National Academies of Sciences, Engineering, and Medicine. Dietary Reference Intakes for Sodium and Potassium. Washington, DC: The National Academies Press, 2019. Link
  6. U.S. Department of Agriculture, Agricultural Research Service. FoodData Central. Nutrient values used for net-carb figures. Link
Medical Disclaimer: This calculator provides estimates for informational purposes only and does not constitute medical or nutritional advice. Results may vary based on individual factors. Consult a registered dietitian or qualified healthcare provider before making significant dietary changes, particularly if you have a medical condition, are pregnant or breastfeeding, or take prescription medications.

See the formulas behind this calculator, or read how this content is reviewed.