Why Is My Pee Blue? Meds, Dyes, and Infections

Blue or blue-green urine is almost always caused by something you’ve taken, whether it’s a medication, a supplement, or a food containing artificial dye. It looks alarming, but in most cases the color change is harmless and temporary. Less commonly, a bacterial infection or a rare genetic condition can be responsible.

Medications That Turn Urine Blue

This is by far the most common explanation. Several widely used medications produce blue, green, or blue-green urine as a known side effect. The color change happens because your body breaks these drugs down into compounds that carry pigment, and those pigments get filtered out through your kidneys.

The most well-known culprits include amitriptyline, an antidepressant that can make urine look greenish-blue, and cimetidine, used for ulcers and acid reflux. Indomethacin, a pain and arthritis medication, can turn urine green. Propofol, the sedative used before surgery, occasionally produces green urine through a nontoxic pigment that forms in the liver and passes into urine. If you’ve recently had a procedure involving sedation and notice a color change afterward, propofol is the likely reason.

Methylene blue is another common source. It’s used as a medical dye in certain diagnostic procedures and is also found in some over-the-counter urinary tract pain relievers. It will reliably turn your urine blue or blue-green, sometimes strikingly so. The effect wears off once the substance clears your system, typically within a day or two.

If you recently started or changed any medication and your urine turned blue, check the drug’s side effect information. In nearly every case, the discoloration stops once you finish the course or your body fully processes the drug.

Food Dyes and Supplements

Artificial food coloring, particularly blue dyes used in candy, sports drinks, ice cream, and frosted baked goods, can tint your urine blue or green if you consume enough of it. This is especially common in children, who tend to eat brightly colored foods in larger relative quantities. The same applies to certain multivitamins and supplements that contain blue or green dyes in their coatings or formulations.

If you can trace the color change back to something you ate or drank in the last 12 to 24 hours, that’s almost certainly the explanation. The color should return to normal once the dye passes through your system.

Bacterial Infections

A less common but medically important cause is a urinary tract infection with a specific type of bacteria called Pseudomonas aeruginosa. This bacterium produces a blue-green pigment called pyocyanin as part of its normal metabolism. When it colonizes the urinary tract, that pigment can visibly tint your urine.

The key difference here is that you won’t just see a color change. A Pseudomonas UTI typically comes with other symptoms: burning during urination, a strong or unusual odor, cloudy appearance beyond just the color, pelvic pain, or fever. This type of infection is more common in people who have a urinary catheter, are hospitalized, or have a weakened immune system. If your blue-green urine comes with any of these symptoms, it points toward infection rather than something you ingested.

Rare Genetic Conditions

Two inherited metabolic disorders can cause blue urine, though both are quite rare and are almost always identified in infancy.

Blue diaper syndrome gets its name from the distinctive blue staining parents notice in their infant’s diaper. It stems from a defect in how the body handles tryptophan, one of the amino acids found in protein. When tryptophan isn’t properly absorbed in the intestine, gut bacteria convert it into a compound called indican, which turns blue when it oxidizes in urine. Affected infants also tend to have diarrhea, and the condition is associated with excessive calcium in the urine.

Hartnup disease involves a similar pathway. A genetic mutation reduces the body’s ability to transport certain amino acids from the intestine and kidneys into cells. Those amino acids, including tryptophan, are lost in the urine instead of being used by the body. The bacterial breakdown of unabsorbed tryptophan can again produce blue-tinged compounds. Hartnup disease can also cause a skin rash similar to pellagra and neurological symptoms, though many people with the genetic mutation never develop noticeable problems.

If you’re an adult noticing blue urine for the first time, a genetic cause is extremely unlikely. These conditions present early in life and are diagnosed through newborn screening or during infancy when symptoms first appear.

How to Figure Out Your Cause

Start with the simplest explanation. Think back over the last 24 to 48 hours: did you take any new medication, eat anything with vivid blue or green coloring, or have any medical procedure? If yes, that’s almost certainly your answer, and the color should resolve on its own within a day or two once the substance clears.

If you can’t identify anything you’ve eaten or taken, pay attention to other symptoms. Pain, burning, fever, or foul-smelling urine alongside the color change suggests an infection that needs treatment. Blue urine that persists for more than two to three days without an obvious dietary or medication explanation is also worth getting checked out. A standard urinalysis can quickly distinguish between a harmless pigment and something that needs attention, like bacteria or an unusual metabolic byproduct.

For most people who find themselves staring into the toilet in confusion, the answer is straightforward: something you consumed contained a dye or compound your kidneys filtered out. It looks dramatic, but your body is doing exactly what it’s supposed to do.