foamy keto urine
|

Foamy Urine: Causes, When to Worry and the Test to Ask For (Including on Keto)

Medically reviewed by John Martinez, M.D. · Updated October 31, 2026

The short answer: Foamy urine is usually harmless. Most of the time it comes from a strong stream hitting the water, or from concentrated urine when you haven’t had enough to drink. If the foam shows up every time, lasts for more than a week or two even when you’re well hydrated, or comes with swelling in your legs or around your eyes, ask your doctor for a urine albumin test (UACR). It checks for protein leaking into your urine, which is the cause of foam that matters.

One of the most common questions I hear, especially from people who have just started a ketogenic or low-carb diet, is “Why is my pee foamy?” Here’s what causes it, what’s different on keto, and when it’s worth a test.

Gloved hand holding a labelled urine sample cup

What makes urine foam?

Any liquid that hits water hard will trap some air and make bubbles. Ordinary bubbles in urine are large, clear and gone within a minute or so.

Foam that is thick, white, looks like the head on a beer and is still sitting there several minutes later is different. That kind of foam usually means something in the urine is acting like soap and holding the bubbles together. The most important “something” is protein. Healthy kidneys keep almost all protein in the blood. When the kidneys’ filters are damaged, protein (mainly albumin) leaks into the urine and makes it foam [1][3].

In one study of clinic patients who came in complaining of foamy urine, about 1 in 5 had a significant amount of protein in their urine [2]. So most foamy urine is harmless, but not all of it, and a simple test tells the difference.

Harmless causes of foamy urine

  • A strong or fast stream. A full bladder, or peeing from a height into the toilet, whips more air into the water. This is the most common cause, and the bubbles disappear quickly.
  • Concentrated urine. When you’re low on fluids, your urine is darker and more concentrated, and it can foam more. It clears up once you drink more.
  • Toilet bowl cleaners. Some cleaning products foam on their own when anything hits the water. If the foam only happens at home, this may be why.
  • Semen in the urine. Men may notice foam the first time they urinate after ejaculation. Some men have retrograde ejaculation, where semen goes backward into the bladder and comes out with the urine. Common causes are alpha-blocker medicines for the prostate (such as tamsulosin, sold as Flomax, or silodosin), diabetes and prostate surgery.

Some medicines change how urine looks. Phenazopyridine (Azo, Pyridium), used for bladder-infection pain, turns urine bright orange, for example. But medicines are not a common cause of foam.

Foamy urine on keto

If you’ve just started a ketogenic diet and noticed foam, it’s very likely one of these.

You’re making more urine

In the first week or two of keto, your body uses up its stored glucose (glycogen). Each gram of glycogen is stored with roughly 3 grams of water [7], so as glycogen drops, you lose that water, mostly as urine. Most people also drink more on keto to avoid the “keto flu.” More urine means a fuller bladder and a stronger stream, which means more bubbles. This usually settles down within a few weeks.

You’re low on fluids or electrolytes

The same early water loss can leave you dehydrated, which makes urine concentrated and foamier. Drink enough that your urine is pale yellow, and make sure you’re getting enough sodium, potassium and magnesium, especially in the first couple of weeks. If you’re also feeling wiped out, see Why am I exhausted on the keto diet?

You’re eating a lot of protein

A very high protein intake increases the waste your kidneys have to clear, so urine can be more concentrated, especially if you’re not drinking enough. But eating protein doesn’t make healthy kidneys leak protein into the urine. If you’ve eased back on protein, you’re well hydrated and the foam is still there, that’s the time for the urine test below. For how much protein you actually need, see How much protein do you need on a ketogenic diet?

Ketones in your urine (probably not the cause)

Ketones commonly show up in urine during the first weeks of keto, and you’ll sometimes read that they cause foam. There’s no good evidence for that. Ketones aren’t protein, and they don’t make urine foam the way protein does.

Important if you have diabetes: SGLT2 inhibitors and keto

Taking an SGLT2 inhibitor? Drugs such as empagliflozin (Jardiance), dapagliflozin (Farxiga), canagliflozin (Invokana) and ertugliflozin (Steglatro) lower blood sugar by putting sugar into your urine. Combined with a ketogenic diet, they can cause a dangerous condition called euglycemic diabetic ketoacidosis, which can happen even when your blood sugar looks normal [4][5]. Don’t start keto on one of these drugs without talking to your doctor first, and don’t stop them on your own either. Nausea, vomiting, belly pain, unusual tiredness or trouble breathing need same-day medical care.

When foamy urine is a sign of something else

Protein in the urine and kidney disease

Foam that persists is the classic sign of proteinuria (protein in the urine). It can be the first visible sign of kidney disease, and kidney disease often causes no other symptoms until it’s advanced [1]. That’s why it’s worth testing rather than waiting.

When a lot of protein is leaking, people often notice swelling in the ankles, legs or around the eyes, especially in the morning. Foamy urine plus swelling is the typical picture of nephrotic syndrome [3] and needs a prompt visit to your doctor.

Diabetes

If your blood sugar is high, sugar spills into the urine. Over the years, diabetes can also damage the kidneys’ filters and let protein leak through, which is one of the most common causes of persistent foam. If you have type 2 diabetes, or have had type 1 diabetes for 5 years or more, your doctor should check a urine albumin test at least once a year [6]. If you’re wondering whether your blood sugar and insulin are where they should be, try the HOMA-IR calculator.

High blood pressure

Long-standing high blood pressure can damage the kidneys in the same way. If you have high blood pressure and notice your urine starting to foam, let your doctor know. It can be a hint that your blood pressure isn’t well controlled and is starting to affect your kidneys. Many people who follow a low-carb diet lose weight, and weight loss helps lower blood pressure. For more, see 10 simple and natural tips to strengthen your heart.

Infections and stones

A urinary tract infection or a kidney stone usually announces itself with other symptoms: burning or pain when you urinate, needing to go often, blood in the urine, cloudy or foul-smelling urine, fever, or pain in your side or back. Any of those, with or without foam, is a reason to see your doctor.

Athletes and hard exercise

Two things I see in athletes are worth knowing:

  • Hard exercise can briefly put protein in your urine. A long run, race or hard training session can raise urine protein for a day or so. It’s harmless and goes away with rest, but it can make a urine test look abnormal [6]. If you’re getting tested, skip hard exercise the day before.
  • Cola- or tea-colored urine after hard exercise is an emergency. It can mean rhabdomyolysis, a breakdown of muscle that can damage the kidneys. If your urine turns dark brown after a hard workout, especially with severe muscle pain or weakness, get medical care the same day.

When to see your doctor about foamy urine

See your doctor if:

  • the foam happens most times you urinate and lasts more than a week or two, even when you’re well hydrated;
  • you have swelling in your legs, ankles or around your eyes;
  • you have diabetes, high blood pressure or known kidney disease and notice new foam;
  • you also have pain or burning, blood in your urine, fever, or side or back pain;
  • you’re on keto and taking an SGLT2 inhibitor, or you feel sick with nausea, vomiting or belly pain.

Which test to ask for

Ask your doctor for a urine albumin-to-creatinine ratio (UACR). It’s done on a single urine sample, so there’s no 24-hour collection. It’s usually done along with a urinalysis and a blood test of kidney function (creatinine and eGFR).

  • A UACR under 30 mg/g is normal [6].
  • If it’s high, your doctor will usually repeat it, because hard exercise in the previous 24 hours, a fever or infection, very high blood sugar, very high blood pressure or a menstrual period can raise it temporarily [6].
  • If it’s still high on repeat testing, your doctor will look for the cause, most often diabetes or high blood pressure, and there are effective treatments that protect the kidneys.

Want to know which other tests your annual physical may be missing? Get my free 4 Labs guide.

Frequently asked questions

Is foamy urine on keto normal?

Usually, yes. In the first few weeks of keto most people urinate more, and a fuller bladder and stronger stream make more bubbles. If it lasts more than a week or two after you’re well hydrated, get a urine albumin test.

Can drinking more water reduce foamy urine?

Yes, if the foam is from concentrated urine. If it’s from protein, drinking more won’t make it go away, which is one clue that it’s worth a test.

How do I get rid of foamy urine?

Treat the cause. Drink enough to keep your urine pale yellow and skip foaming toilet cleaners. If the foam persists, have your doctor check for protein in your urine. If protein is found, treating the underlying cause (often blood sugar or blood pressure) is what helps.

Do bubbles in urine mean diabetes?

Not by themselves. But diabetes can cause both sugar and protein in the urine, so if you have persistent foam, it’s reasonable to check a fasting glucose or HbA1c along with the urine test.

What does protein in pee look like?

Protein-related foam tends to be thick and white, looks like the head on a beer, shows up every time you urinate and is still there several minutes later. You can’t confirm it by looking, though: only a urine test can tell you.

Can ketosis cause protein in your urine?

There’s no good evidence that a ketogenic diet causes protein in the urine in people with healthy kidneys. Ketones in the urine are common on keto, but ketones aren’t protein. If a urine test shows protein, look for another cause.

What does pee look like during ketosis?

Usually normal. You may pee more often in the first couple of weeks, and the urine may be paler if you’re drinking more. Some people notice a stronger or slightly sweet smell. Ketone test strips turn purple, but that only tells you ketones are present, not anything about your kidneys.

References

  1. Khitan ZJ, Glassock RJ. Foamy urine: is this a sign of kidney disease? Clin J Am Soc Nephrol. 2019;14(11):1664–1666. doi:10.2215/CJN.06840619
  2. Kang KK, Choi JR, Song JY, et al. Clinical significance of subjective foamy urine. Chonnam Med J. 2012;48(3):164–168. doi:10.4068/cmj.2012.48.3.164
  3. Dantas M, Barros Silva GE, Moysés-Neto M. Foamy urine in nephrotic syndrome. Clin Kidney J. 2013;6(3):341. doi:10.1093/ckj/sft018
  4. Patel K, Nair A. A literature review of the therapeutic perspectives of sodium-glucose cotransporter-2 (SGLT2) inhibitor-induced euglycemic diabetic ketoacidosis. Cureus. 2022;14(9):e29652. doi:10.7759/cureus.29652
  5. Alhemeiri M, Alseddeeqi E. Euglycemic diabetic ketoacidosis after discontinuing SGLT2 inhibitor. Case Rep Endocrinol. 2022;2022:4101975. doi:10.1155/2022/4101975
  6. American Diabetes Association Professional Practice Committee. 11. Chronic kidney disease and risk management: Standards of Care in Diabetes—2026. Diabetes Care. 2026;49(Suppl 1):S246–S260. doi:10.2337/dc26-S011
  7. Fernández-Elías VE, Ortega JF, Nelson RK, Mora-Rodriguez R. Relationship between muscle water and glycogen recovery after prolonged exercise in the heat in humans. Eur J Appl Physiol. 2015;115(9):1919–1926. doi:10.1007/s00421-015-3175-z

This article is for general education and isn’t a substitute for a visit with your own doctor.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.