It doesn’t seem to have any correlation with the concentration of the urine, as even really dark stuff is usually froth-free.
Is it saltier when it’s frothy?
How much protein is in it, but also some splash patterns are better at introducing air bubbles than others.
It seems like I recall that has something to do with protein content? Source: Fuzzy memory.
From healthline:
The most obvious cause of foamy urine is the speed of urination. Just as water foams up when it comes out of the tap quickly, urine foams if it hits the toilet quickly. This kind of foam should also clear up quickly.
Sometimes, urine can also foam up when it’s concentrated. Your urine is more concentrated if you haven’t had much water to drink and you’re dehydrated.
Foamy urine can also indicate that you have too much of a protein, such as albumin, in your urine. The protein in your urine reacts with the air to create foam.
Normally, your kidneys filter extra water and waste products out of your blood into your urine. Protein and other important substances that your body needs are too big to fit through the kidneys’ filters, so they stay in your bloodstream.
But when your kidneys are damaged, they don’t filter as well as they should. Damaged kidneys can allow too much protein to leak into your urine. This is called proteinuria. It’s a sign of chronic kidney disease or the late stage of kidney damage, called end-stage renal disease.
A less common cause of foamy urine is retrograde ejaculation, which is a condition that happens in men when semen backs up into the bladder instead of being released from the penis.
Amyloidosis is a rare condition that can also cause foamy urine, fluid buildup, and problems for the kidneys. It is caused by the buildup of a specific protein, and can affect many organs.
Taking the medicine phenazopyridine (Pyridium, AZO Standard, Uristat, AZO) is another less common cause of foamy urine. People take this medication to treat the pain from urinary tract infections.
And sometimes, the problem is actually just your toilet. Some toilet cleaning chemicals can make your urine look foamy. If this is the cause, the foam should stop as soon as you flush the cleaner out of the toilet.
Usually if that happens it means one of a few things.
If it is intermittent and not accompanied by other symptoms, it may be because of a high protein content in the urine. This is pretty common, and can happen for a few reasons, but sometimes it just happens. If it happens super frequently (several times a week, for example), then get it looked at because it can be an indicator of bad kidney function.
If the froth is constant for a long period of time, it could indicate a UTI, even without other symptoms. If you have no other issues, you could try taking cranberry pills and see if it clears up. Again, if it keeps happening repeatedly, see a doctor just to be safe.
Last option is you could have an STI, but if you have no other symptoms and no reason to suspect exposure, then you can safely rule that out.
Source: I get this occasionally too and have nurses comment on it whenever I need to give a urine sample for various tests.