Scenario

Keto Electrolyte Calculator — Avoid the Keto Flu

Calculate your daily electrolyte needs on keto. Sodium 3–5g, potassium 2–3g, and magnesium 300–400mg replace what low-carb excretion flushes out daily.

Interactive Calculator

Your Details

kg
cm
years

Your Keto Macros

Fat

156g

Protein

126g

Carbs

25g

Total Calories

2009kcal

Macro Distribution (70/25/5)

Classic ketogenic ratio: 70% fat, 25% protein, 5% carbs.

Calorie Breakdown by Macro

Calories contributed by each macronutrient group.

Keto Summary
Based on your stats, your estimated TDEE is 2,009 kcal. On a standard ketogenic diet (70% fat, 25% protein, 5% carbs), your daily targets are 156 g of fat, 126 g of protein, and 25 g of carbs.
The formula

The formula

What Keto Macros Measure

The ketogenic diet is a very low-carbohydrate, high-fat diet designed to shift the body's primary fuel source from glucose to ketones — a metabolic state called ketosis. On a standard keto diet, approximately 70% of daily calories come from fat, 25% from protein, and only 5% from carbohydrates. This dramatic shift in macronutrient ratios forces the body to produce ketone bodies from fat stores, which can then be used as energy by the brain and muscles.

Keto macros are not a one-size-fits-all prescription. The ideal macronutrient split depends on your total daily energy expenditure (TDEE), body composition goals, activity level, and individual metabolic response. Our calculator first estimates your TDEE using the Mifflin-St Jeor equation, then applies the standard keto macro percentages to give you a personalized target in grams of fat, protein, and carbohydrates per day.

The Keto Macro Formula

TDEE = BMR × Activity Factor

BMR (Mifflin-St Jeor): 10 × weight(kg) + 6.25 × height(cm) − 5 × age + 5 (male)

Keto Macros: 70% fat, 25% protein, 5% carbs

Fat grams: (TDEE × 0.7) ÷ 9

Protein grams: (TDEE × 0.25) ÷ 4

Carb grams: (TDEE × 0.05) ÷ 4

Formula Source

This calculator uses the standard ketogenic diet macronutrient ratio (70/25/5) as commonly applied in clinical research and dietary intervention studies. The Mifflin-St Jeor equation for estimating BMR is from Mifflin MD, St Jeor ST et al., American Journal of Clinical Nutrition, published in 1990. The keto macro split is referenced from the National Lipid Association and peer-reviewed ketogenic diet studies.

Reference URL: https://doi.org/10.1016/j.nutres.2017.10.003

Last Verified: 2026-07-30

Worked Example

A 35-year-old active male weighing 75 kg at 175 cm tall has a BMR of approximately 1,694 kcal using the Mifflin-St Jeor equation. With an activity factor of 1.55 (moderate activity), his TDEE is about 2,626 kcal per day. On standard keto macros, that translates to approximately 204 g of fat, 164 g of protein, and 33 g of carbohydrates per day. A 30-year-old sedentary female weighing 65 kg at 165 cm has a BMR of roughly 1,377 kcal, a TDEE of about 1,652 kcal (activity factor 1.2), and would target roughly 129 g fat, 103 g protein, and 21 g carbs per day.

Keto Macro Reference Table

Macronutrient% of CaloriesCalories per GramRole in Keto
Fat70%9 kcal/gPrimary energy source
Protein25%4 kcal/gMuscle preservation & repair
Carbohydrates5%4 kcal/gMinimized to maintain ketosis

Why Keto Macros Alone Are Not a Full Picture

While the standard 70/25/5 macro split is a useful starting point, several factors can significantly alter your individual keto needs. Your actual carb tolerance for maintaining ketosis depends on metabolic flexibility, muscle mass, and activity level — some people can stay in ketosis at 50 g of carbs per day, while others need to stay below 20 g. The protein ratio is also debated: too little protein risks muscle loss, while too much may theoretically reduce ketone production through gluconeogenesis, though this effect is often overstated in practice.

Additionally, the quality of your fat sources matters. Emphasizing monounsaturated and saturated fats from whole food sources (avocado, olive oil, nuts, seeds, fatty fish, coconut) is nutritionally superior to relying on processed keto-friendly packaged foods. Electrolyte balance — particularly sodium, potassium, and magnesium — requires attention on keto, as the diuretic effect of low insulin levels can deplete these minerals and cause the so-called "keto flu." A comprehensive approach to keto considers total calorie intake, food quality, hydration, electrolyte supplementation, and individual response, not just the macro percentages.

Known Limitations

  • Individual keto macro needs vary significantly; some people require stricter carb limits (<20 g net carbs) to enter and maintain ketosis.
  • The calculator assumes a standard 70/25/5 split; therapeutic keto for epilepsy uses different ratios (often higher fat, lower protein) and should only be followed under medical supervision.
  • BMR estimation uses a male formula by default; female users may have slightly different metabolic baselines due to hormonal cycles and body composition differences.
  • The formula does not account for body composition, medication interactions, thyroid function, or metabolic conditions that affect energy expenditure.
  • Consult a healthcare provider before starting a ketogenic diet, especially if you have diabetes, pancreatitis, liver disease, or a history of disordered eating.
Scenario guide

Scenario guide

Why Electrolytes Matter on Keto

When you reduce carbohydrate intake dramatically, your body produces less insulin. Insulin signals the kidneys to retain sodium, so lower insulin levels cause the kidneys to excrete significantly more sodium — and with it, water, potassium, and magnesium. This electrolyte depletion is the primary cause of the keto flu: the headaches, fatigue, muscle cramps, and brain fog that many people experience in the first 1 to 2 weeks of a ketogenic diet. Adequately replacing these electrolytes is one of the most effective strategies for preventing or eliminating keto flu symptoms entirely.

Sodium: The Most Important Electrolyte on Keto

Sodium depletion is the most common electrolyte deficiency on keto and a primary driver of headaches, dizziness, and fatigue. The recommended daily sodium intake on a ketogenic diet is 3,000 to 5,000mg, substantially higher than the standard dietary guidelines. This increased need reflects the higher renal sodium excretion caused by reduced insulin levels. Practical ways to increase sodium include salting food generously, adding 1 to 2 teaspoons of sea salt to water throughout the day, consuming broths and bouillon, and choosing naturally salty foods like cured meats and pickles. Many people find that a salty snack in the morning resolves persistent headaches within 30 minutes.

Potassium: Preventing Muscle Cramps

Potassium works closely with sodium to regulate fluid balance, nerve function, and muscle contractions. The recommended daily potassium intake on keto is 2,000 to 3,000mg. Symptoms of potassium deficiency include muscle cramps, heart palpitations, fatigue, and constipation. Food sources of potassium that fit well into a keto diet include avocados (about 970mg per fruit), spinach (840mg per cup cooked), salmon (530mg per fillet), mushrooms (350mg per cup), and olives. Because potassium supplements without food can cause gastrointestinal distress, it is generally better to increase intake through foods rather than pills unless specifically directed by a healthcare provider.

Magnesium: Sleep, Cramps, and Energy

Magnesium deficiency is extremely common in the general population and becomes even more prevalent on keto due to increased renal excretion. The recommended daily magnesium intake is 300 to 400mg for adults. Deficiency manifests as muscle cramps (especially nighttime leg cramps), poor sleep quality, anxiety, and persistent fatigue. Magnesium glycinate and magnesium citrate are the most bioavailable supplement forms. Food sources suitable for keto include pumpkin seeds (150mg per ounce), almonds (80mg per ounce), dark leafy greens, and dark chocolate (70 percent cocoa or higher). Taking magnesium glycinate before bed often improves both sleep quality and morning energy on keto.

Supplement Strategy and Timing

  • Morning: Start the day with a large glass of water containing 1 to 2 teaspoons of sea salt or Himalayan pink salt to replenish overnight sodium losses and stabilize blood pressure.
  • With meals: Include potassium-rich foods at every meal — avocado, leafy greens, and fatty fish are excellent choices that fit naturally into keto meal plans.
  • Before bed: Take 300 to 400mg of magnesium glycinate 30 minutes before sleep to support relaxation, reduce nighttime cramps, and improve sleep quality.
  • During exercise: Add electrolyte supplements to water during and after workouts. A keto-friendly electrolyte mix without sugar ensures you do not accidentally exceed your carb budget.
  • Ongoing adjustment: Monitor how you feel and adjust amounts accordingly. If headaches or fatigue persist, increase sodium. If cramps continue, focus on magnesium and potassium. Most people stabilize within 2 to 4 weeks.
FAQ

Frequently Asked Questions

Why do I need more electrolytes on keto?
Lower insulin levels on keto cause the kidneys to excrete more sodium, water, and associated electrolytes like potassium and magnesium. This depletion causes the keto flu — headaches, fatigue, and cramps — and must be actively replaced through diet and supplements.
How much sodium do I need on keto?
On a ketogenic diet, aim for 3,000 to 5,000mg of sodium per day, which is significantly higher than standard guidelines. Salt your food liberally, drink broth, and add sea salt to water throughout the day.
What are the best electrolyte supplements for keto?
For sodium, use sea salt or Himalayan pink salt. For magnesium, magnesium glycinate or citrate (300 to 400mg daily) is most bioavailable. For potassium, focus on food sources like avocados and spinach rather than pills, which can cause GI distress.
How long does keto flu last?
With adequate electrolyte supplementation, keto flu symptoms typically resolve within 3 to 7 days. Without electrolyte support, symptoms can persist for 2 to 4 weeks until the body fully adapts to fat burning.
Can I get enough electrolytes from food alone on keto?
Potassium and magnesium can often be obtained from keto-friendly foods like avocados, leafy greens, nuts, and fish. Sodium is harder to get from food alone, so most people benefit from salting food aggressively and adding salt to water.
Keep going