Electrolytes on Keto: Sodium, Potassium and Magnesium

The three electrolytes people focus on during keto are sodium, potassium and magnesium. Many people pass more urine in the first weeks of keto, and a 2026 review of the diet’s side effects lists this among the most common early effects. The safest approach is to get these minerals from food first: a little extra salt or broth if your doctor hasn’t told you to limit it, plus potassium and magnesium from leafy greens, avocado, nuts, seeds and fish. Supplements can be risky for people with kidney or heart problems, or on some medicines.

Woman drinking a glass of water

What electrolytes do

Electrolytes are minerals that carry an electrical charge in your body’s fluids. They help control fluid balance, nerve signals, muscle contractions and heart rhythm. The main ones discussed on keto are:

  • Sodium: mostly from salt. It helps control fluid balance and blood pressure.
  • Potassium: found in vegetables, fruit, beans, nuts, fish and dairy.
  • Magnesium: found in nuts, seeds, leafy greens, whole grains and beans.

Why keto can affect electrolytes

When you cut carbohydrate sharply, many people pass more urine in the first days and weeks. The 2026 review lists polyuria, the medical term for passing more urine, among keto’s most frequently reported side effects. It also names electrolyte disturbances as a reason for particular caution with the diet.

At the same time, keto cuts out some of the usual sources of potassium and magnesium, such as fruit, beans, potatoes and whole grains. Harvard’s Nutrition Source lists magnesium among the minerals that can run short on keto.

In the largest study of “keto flu” reports, people’s suggested remedies centered on fluids and electrolytes: eating more salt, taking electrolytes, drinking broth, and getting more magnesium and potassium (source). None of these remedies has been tested in a proper trial, but they explain why electrolytes come up so often. Our guide to keto flu covers the other symptoms.

How much do you need?

MineralAdult daily amountSource of the figure
SodiumUnder 2,000 mg (5 g of salt)World Health Organization upper limit
Potassium3,400 mg men, 2,600 mg womenUS adequate intake
Magnesium400 to 420 mg men, 310 to 320 mg womenUS recommended amount

Sources: the WHO for sodium, and the NIH Office of Dietary Supplements fact sheets on potassium and magnesium.

Notice that sodium has an upper limit, not a target. Most people already eat more salt than the WHO recommends: the WHO’s salt fact sheet puts average adult intake worldwide at about double the limit. On keto, cutting out bread, crackers and packaged foods can lower salt intake, which is one reason some people feel better with a little salt added back during the first weeks. If you have high blood pressure, heart failure or kidney disease, follow your doctor’s advice on salt rather than adding more.

Keto foods rich in potassium and magnesium

Per 100 g, from USDA FoodData Central:

Food (100 g)PotassiumMagnesium
Pumpkin seeds809 mg592 mg
Almonds733 mg270 mg
Spinach, raw558 mg79 mg
Avocado485 mg29 mg
Salmon, farmed363 mg27 mg
Mushrooms, white318 mg9 mg
Broccoli316 mg21 mg

Nuts and seeds are rich but easy to overeat, so a portion of about 30 g (a small handful) is sensible. Leafy greens, avocado, mushrooms and broccoli are low in net carbs, so you can eat generous amounts. The keto food list has more options.

Practical ways to get electrolytes on keto

  1. Eat vegetables at every meal, especially leafy greens, avocado, broccoli and mushrooms.
  2. Snack on nuts and seeds in measured portions, such as 30 g of almonds or pumpkin seeds.
  3. Include fish such as salmon or sardines a few times a week.
  4. Drink enough fluid. Aim for pale yellow urine, the simple guide the NHS uses.
  5. Consider a cup of broth in the first week or two if you feel lightheaded and your doctor hasn’t told you to limit salt. Ready-to-serve chicken broth has about 371 mg of sodium per 100 ml (USDA).
  6. Don’t cut salt to the bone during the first weeks, unless you’ve been told to.

Should you take electrolyte supplements?

Food is the safest source, and many people never need supplements. Be careful with them, especially potassium:

  • Potassium supplements and salt substitutes (which often contain potassium chloride) can be dangerous for people with kidney disease, and for people taking medicines that raise potassium, such as ACE inhibitors, ARBs or potassium-sparing diuretics. Don’t take them without your doctor’s advice. The NIH Office of Dietary Supplements explains these interactions.
  • Magnesium supplements commonly cause diarrhea at higher doses. The US upper limit for magnesium from supplements is 350 mg a day for adults, according to the NIH Office of Dietary Supplements. People with kidney disease should only take magnesium if their doctor advises it.
  • Electrolyte drinks and powders vary widely. Many sports drinks contain sugar, so choose sugar-free versions if you use them, and check the sodium content.

If you take medicines for blood pressure, heart failure or diabetes, talk to your doctor before starting keto and before taking any electrolyte supplement. The 2026 review flags diuretics and blood pressure treatment as needing particular care on keto.

Signs to get medical help

Seek medical advice promptly if you have:

  • a racing, pounding or irregular heartbeat
  • severe muscle weakness or cramps that don’t settle
  • fainting or severe dizziness
  • confusion, vomiting or extreme tiredness

These aren’t normal keto adjustment symptoms and can have serious causes.

Before you start

Safety note: A ketogenic diet isn’t safe for everyone. Don’t start one without medical supervision if you have type 1 diabetes, take insulin or other diabetes medicines (especially SGLT2 inhibitors such as empagliflozin or dapagliflozin), take medicine for high blood pressure, have kidney, liver, pancreas or gallbladder disease, are underweight or have had an eating disorder, or are pregnant or breastfeeding. Children should only follow keto as a medical treatment run by a specialist team. A 2026 review of keto’s contraindications lists these and other situations that need care, so talk to your doctor first if any apply to you.

This article is general information, not medical advice. Talk to your doctor or a registered dietitian before making big changes to how you eat, especially if you have a health condition, take regular medication, or are pregnant or breastfeeding.