Blue urine is almost always caused by something you consumed, whether that’s a medication, a food dye, or a supplement. It looks alarming, but in most cases it’s harmless and clears up on its own within hours to a day. Less commonly, blue or blue-green urine can signal a bacterial infection or, in infants, a rare genetic condition.
Medications That Turn Urine Blue
The most common cause of blue urine is medication. A wide range of drugs can shift urine color into the blue or blue-green spectrum, including certain antidepressants, anti-inflammatory drugs, acid reflux medications, and even some erectile dysfunction pills. The color change happens because your body breaks these drugs down into metabolites that carry pigment, and those metabolites get filtered out through your kidneys.
Methylene blue is the most well-known offender. It’s a blue dye with mild antiseptic properties, and it shows up as an ingredient in several bladder medications used to relieve urinary irritation. If you’ve been prescribed one of these for bladder discomfort, the blue urine is expected. Methylene blue is also given intravenously in hospitals to treat a blood condition where red blood cells can’t carry oxygen properly. In either case, blue staining of the urine, skin, and even the whites of the eyes can occur.
Propofol, a common anesthetic used during surgery, can produce green or blue-green urine. Your liver breaks propofol down into a group of phenolic compounds, and these metabolites give urine its unusual color. This typically appears within a couple of hours after surgery and resolves within about 8 to 10 hours, though traces can sometimes remain detectable for up to 24 hours. If you wake up from a procedure and notice green-tinted urine, propofol is the likely explanation.
The diuretic triamterene, used to manage fluid retention and high blood pressure, can also give urine a blue fluorescent quality. Its chemical structure absorbs ultraviolet light and produces blue fluorescence in acidic solutions, which means urine may look distinctly blue under certain lighting conditions.
Food Dyes and Supplements
Synthetic food dyes, particularly FD&C Blue No. 1, can color your urine if you consume enough. This dye is found in breakfast cereals, juice drinks, soft drinks, frozen dairy desserts, and candy. Most people eating a normal diet won’t notice a change, but if you’ve consumed a large quantity of brightly colored food or drinks (think birthday cake frosting, blue sports drinks, or blue-colored candy), the dye can pass through your system and tint your urine. B vitamins, which are common in energy drinks and multivitamins, can also contribute to unusual urine colors ranging from bright yellow to greenish-blue.
Bacterial Infections
A urinary tract infection caused by the bacterium Pseudomonas aeruginosa can produce blue-green urine. This bacterium is notable because 90 to 95 percent of its strains produce a blue pigment called pyocyanin. When the same bacterium also produces a yellow pigment called fluorescein, the combination creates the characteristic green color often seen in lab cultures and, occasionally, in urine.
Pseudomonas infections are more common in people with catheters, compromised immune systems, or prolonged hospital stays. Unlike a medication-related color change, an infection will usually come with other symptoms: pain or burning during urination, fever, cloudy urine, or a strong odor. The color alone isn’t dangerous, but the underlying infection needs treatment.
Genetic and Metabolic Conditions
In infants, blue urine can point to a rare inherited condition sometimes called Blue Diaper Syndrome (formally known as familial benign hypercalcemia). In this condition, the baby’s intestines can’t properly absorb tryptophan, an amino acid found in breast milk and formula. Bacteria in the gut break down the unabsorbed tryptophan into a compound called indole. When indole gets processed by the liver and excreted in urine, it oxidizes into indigo blue, literally staining the diaper. Affected infants also tend to have early-onset diarrhea, fever, low blood sugar episodes, and high calcium levels that can damage the kidneys.
A related condition, Hartnup disease, involves a defect in a protein responsible for transporting neutral amino acids across the intestinal wall and kidney tubules. The result is similar: excess tryptophan sits in the gut, colonic bacteria convert it into indolic compounds, and the liver packages those compounds into a substance called indican that gets excreted in urine. Both conditions are rare and typically identified in early childhood through specialized urine testing.
How Doctors Identify the Cause
If you notice blue urine, the first thing to consider is whether you recently took a new medication, had a medical procedure, or ate or drank anything with strong artificial coloring. In most cases, the answer is obvious and the color change resolves within a day.
When the cause isn’t clear, doctors start with a thorough history and a standard dipstick urinalysis, which can flag signs of infection, blood, or bile pigments. If a bacterial infection is suspected, a urine culture can identify organisms like Pseudomonas aeruginosa, and fluorescence testing can confirm the presence of its blue pigment. For suspected metabolic disorders, particularly in infants or young children, more advanced lab work can analyze urinary amino acids to check for conditions like Hartnup disease or Blue Diaper Syndrome.
How Long It Lasts
When a medication or food dye is responsible, blue urine is temporary. In studies involving methylene blue, urine color returned to normal within about 8 to 10 hours after the substance cleared the body, though faint traces could persist for up to 24 hours. The timeline depends on how much of the substance you consumed, how well your kidneys are functioning, and how hydrated you are. Drinking more water speeds clearance by diluting the pigment and increasing urine output.
If the color persists beyond a couple of days and you can’t trace it to anything you’ve eaten or taken, or if it comes with pain, fever, or any blood in the urine, that warrants a medical evaluation. Persistent discoloration without an obvious dietary or pharmaceutical explanation is uncommon, but it can indicate an infection or metabolic issue that benefits from early identification.