Electrolyte Calculator

Calculate your personalized daily sodium, potassium, magnesium, and calcium targets based on your age, activity level, climate, diet, and special conditions.

Calculate Your Electrolyte Needs

Average daily exercise duration including warmup

What Are Electrolytes?

Electrolytes are minerals that carry an electrical charge in your body. Sodium, potassium, magnesium, and calcium regulate nerve and muscle function, maintain hydration, balance blood pH, and support heart rhythm. Your daily needs vary based on age, sex, physical activity, sweat rate, climate, and diet. Even mild imbalances can cause fatigue, muscle cramps, headaches, and irregular heartbeat. Athletes, people on restrictive diets, and those in hot climates are at highest risk for electrolyte depletion.

While most people meet their electrolyte needs through a balanced diet, specific groups — athletes, people on keto or fasting protocols, those living in hot climates, and pregnant or lactating women — often need to pay closer attention. This calculator uses NIH Adequate Intake values as a baseline and adds personalized adjustments for sweat losses, diet-induced excretion, and special conditions.

Medical Disclaimer: This tool provides general educational estimates. Always consult your prescribing physician or healthcare provider before making medication changes or interpreting results from population-based models.

How Electrolyte Needs Are Calculated

Your personalized targets are built from three layers: baseline dietary reference values, exercise-related sweat losses, and diet-specific adjustments.

Calculation Method

  • Step 1 — Baseline (AI/RDA): The starting point is the Adequate Intake (AI) or Recommended Dietary Allowance (RDA) for each electrolyte, set by the NIH based on your age and sex. For example, a 30-year-old male has an AI of 1,500 mg sodium, 3,400 mg potassium, 400 mg magnesium, and 1,000 mg calcium per day.
  • Step 2 — Sweat losses: During exercise, you lose electrolytes through sweat. The calculator estimates sweat volume using published sweat rates (0.5-1.8 L/hr depending on intensity), adjusted for exercise duration and climate (temperate, warm, or hot). Each liter of sweat contains approximately 920 mg sodium, 200 mg potassium, 5 mg magnesium, and 30 mg calcium.
  • Step 3 — Diet adjustments: Keto and low-carb diets substantially increase sodium excretion because lower insulin levels reduce the kidneys' ability to retain sodium. This calculator adds 150% of baseline sodium for keto dieters, plus 30% extra potassium and 20% extra magnesium. Fasting has a similar but less pronounced effect. Vegan diets add 200 mg calcium to account for the absence of dairy.
  • Special conditions: Pregnancy and lactation alter potassium, magnesium, and calcium requirements according to IOM guidelines.

The final target is the sum: Baseline + Sweat Losses + Diet Adjustment. Values above the Tolerable Upper Intake Level (UL) are flagged — though UL exceedances are expected and clinically appropriate for heavy exercisers and keto dieters under medical supervision.

NIH Recommended Daily Intake

The following tables show the Adequate Intake (AI) or RDA for each major electrolyte by age and sex, as established by the National Institutes of Health Office of Dietary Supplements and the National Academies of Sciences, Engineering, and Medicine.

Sodium — Adequate Intake (AI)

Age Group AI (mg/day) UL (mg/day)
9–13 years1,2002,200
14–18 years1,5002,300
19–50 years1,5002,300
51–70 years1,3002,300
71+ years1,2002,300

Potassium — Adequate Intake (AI)

Group Male (mg/day) Female (mg/day)
9–13 years2,3002,300
14–18 years3,0002,300
19+ years3,4002,600
Pregnant2,900
Lactating2,800

Magnesium — Recommended Dietary Allowance (RDA)

Group Male (mg/day) Female (mg/day)
9–13 years240240
14–18 years410360
19–30 years400310
31+ years420320
Pregnant350–400
Lactating310–360

Calcium — Recommended Dietary Allowance (RDA)

Group Male (mg/day) Female (mg/day) UL (mg/day)
9–18 years1,3001,3003,000
19–50 years1,0001,0002,500
51–70 years1,0001,2002,000
71+ years1,2001,2002,000

AI = Adequate Intake; RDA = Recommended Dietary Allowance; UL = Tolerable Upper Intake Level. Source: NIH Office of Dietary Supplements fact sheets; NASEM Dietary Reference Intakes, 2019 update.

Electrolytes and Exercise

Exercise is the single largest variable in daily electrolyte needs. A sedentary person in a temperate climate loses minimal electrolytes through sweat, while an endurance athlete training in the heat can lose several grams of sodium in a single session.

Sweat Electrolyte Losses

  • Sweat rate: Averages 0.5-1.8 liters per hour depending on exercise intensity. Light exercise (walking, yoga) produces about 0.5 L/hr, while endurance exercise (marathon running, cycling) can exceed 1.5-2.0 L/hr.
  • Sodium: The dominant electrolyte in sweat, averaging 920 mg per liter (range: 460-1,840 mg/L). A 2-hour intense workout in warm weather can deplete 2,000-3,500 mg of sodium.
  • Potassium: Approximately 200 mg per liter of sweat. Losses are meaningful during prolonged exercise but are generally replaced through normal food intake.
  • Magnesium and Calcium: Lost in small amounts through sweat (5 mg and 30 mg per liter, respectively). Chronic exercise-related depletion can accumulate over time if dietary intake is insufficient.
  • Climate multiplier: Hot and humid conditions increase sweat rate by 25-50% compared to temperate environments. Acclimatization reduces sodium concentration in sweat but increases total sweat volume.

For sessions lasting less than 60 minutes at moderate intensity, water alone is usually sufficient. For longer or more intense sessions — especially in heat — an electrolyte drink containing 300-700 mg sodium per liter is recommended by the American College of Sports Medicine. Heavy sweaters (identified by white salt stains on clothing) may need more.

Electrolytes on Keto and Fasting

Low-carbohydrate and fasting protocols dramatically alter electrolyte balance through hormonal mechanisms that are often underappreciated.

Why Keto Increases Electrolyte Needs

  • Sodium excretion: When carbohydrate intake drops below approximately 50 grams per day, insulin levels fall significantly. Lower insulin signals the kidneys to excrete more sodium rather than reabsorb it. This is the primary driver of "keto flu" — symptoms like headache, fatigue, and dizziness that are largely electrolyte depletion.
  • Glycogen and water: Each gram of glycogen is stored with 3-4 grams of water. As glycogen depletes during carb restriction, significant water (and dissolved electrolytes) is lost in the first 1-2 weeks.
  • Potassium and magnesium: Increased sodium excretion triggers compensatory potassium loss. Magnesium excretion also rises. Many keto practitioners report muscle cramps and poor sleep until they supplement these minerals.
  • Practical targets: Keto-adapted individuals typically need 3,000-5,000 mg sodium, 3,500-4,700 mg potassium, and 400-600 mg magnesium per day — substantially above standard AI values.

During extended fasting (24+ hours), the same mechanisms apply with even greater intensity because no food-based electrolytes are being consumed. Supplementation with sodium (salt in water or broth), potassium (lite salt), and magnesium (citrate or glycinate) is strongly recommended during fasting periods exceeding 24 hours. Intermittent fasting (16:8 or 20:4) has a milder effect and may not require supplementation if meals are electrolyte-rich.

Frequently Asked Questions

How much sodium should I eat per day?

The NIH Adequate Intake for sodium is 1,500 mg/day for adults aged 19-50, with an upper limit of 2,300 mg/day for the general population. However, athletes, people on keto diets, and those working in hot environments often need significantly more. The average American consumes about 3,400 mg/day, which is above the upper limit but may be appropriate for active individuals. People with hypertension or kidney disease should follow their doctor's specific sodium guidance.

What are the signs of electrolyte deficiency?

Common signs include muscle cramps, twitching, fatigue, headache, dizziness, heart palpitations, nausea, and brain fog. Sodium deficiency (hyponatremia) causes confusion and swelling. Potassium deficiency (hypokalemia) causes weakness and irregular heartbeat. Magnesium deficiency causes cramps, anxiety, and insomnia. Calcium deficiency causes numbness, tingling, and muscle spasms. Severe electrolyte imbalances can be life-threatening and require medical attention.

Do I need electrolyte supplements?

Most people eating a varied diet can meet their electrolyte needs through food alone. Supplementation may be beneficial for endurance athletes (especially in heat), people on keto or fasting diets, those taking diuretics, and anyone experiencing symptoms of deficiency like persistent cramps or fatigue. Magnesium is the most commonly deficient electrolyte — an estimated 50% of Americans do not meet the RDA through diet. If supplementing, magnesium glycinate or citrate are better absorbed than magnesium oxide.

What is the ideal sodium-to-potassium ratio?

Research suggests an optimal sodium-to-potassium ratio of approximately 1:1.5 to 1:2, which is associated with lower cardiovascular risk. Most Western diets are inverted — high sodium and low potassium. The WHO recommends consuming less than 2,000 mg sodium and at least 3,510 mg potassium per day. Increasing potassium through fruits, vegetables, and legumes while moderating processed food intake helps achieve a healthier ratio.

Can you have too many electrolytes?

Yes. Excess sodium contributes to hypertension and cardiovascular disease in susceptible individuals. Excess potassium (hyperkalemia) can cause dangerous cardiac arrhythmias, particularly in people with kidney disease. Excess calcium can cause kidney stones and impair absorption of other minerals. Magnesium from supplements (not food) above 350 mg can cause diarrhea and GI distress. People with kidney disease are at highest risk because impaired kidneys cannot efficiently excrete excess electrolytes.

Sources

  1. NIH Office of Dietary Supplements. "Sodium — Fact Sheet for Health Professionals." National Institutes of Health. Updated 2024.
  2. NIH Office of Dietary Supplements. "Potassium — Fact Sheet for Health Professionals." National Institutes of Health. Updated 2024.
  3. NIH Office of Dietary Supplements. "Magnesium — Fact Sheet for Health Professionals." National Institutes of Health. Updated 2024.
  4. NIH Office of Dietary Supplements. "Calcium — Fact Sheet for Health Professionals." National Institutes of Health. Updated 2024.
  5. National Academies of Sciences, Engineering, and Medicine. Dietary Reference Intakes for Sodium and Potassium. Washington, DC: The National Academies Press, 2019.
  6. Institute of Medicine. Dietary Reference Intakes for Calcium and Vitamin D. Washington, DC: The National Academies Press, 2011.
  7. Baker, L.B. (2017). "Sweating Rate and Sweat Sodium Concentration in Athletes: A Review of Methodology and Intra/Interindividual Variability." Sports Medicine, 47(Suppl 1), 111-128.
  8. American College of Sports Medicine. "Exercise and Fluid Replacement — Position Stand." Medicine & Science in Sports & Exercise, 39(2), 377-390, 2007.