Blue pee is almost always caused by something you ate, drank, or took as a medication. It’s uncommon enough to be startling, but in most cases, the color change is harmless and temporary. The blue or blue-green tint comes from dyes or compounds that your kidneys filter out of your blood and deposit into your urine.
Medications That Turn Urine Blue
Medications are the most common reason for blue or blue-green urine. The one most strongly associated with this effect is methylene blue, a dye used medically to treat certain poisonings and to help surgeons visualize tissues during procedures. After even a single dose, urine can take on a vivid blue or green color. In some cases the discoloration appears within hours, though it can take up to a few days depending on the dose and your metabolism. The color typically clears within hours once the compound works its way out of your system.
Several other prescription medications can shift urine into the blue-green range. Amitriptyline, a widely prescribed antidepressant, can produce greenish-blue urine. Indomethacin, a pain and arthritis medication, tends to cause green discoloration. Propofol, the anesthetic commonly used before surgery, can also turn urine green. If you recently had a medical procedure or started a new medication, that’s very likely your answer.
Food Dyes and Supplements
Artificial food coloring, particularly FD&C Blue No. 1 (the dye in many blue candies, drinks, and frostings), can color your urine if you consume enough of it. Most of this dye passes through your digestive tract without being absorbed, but some does get into the bloodstream, and your kidneys filter it out. The result is blue or green-tinged urine that resolves once the dye clears your system, usually within a day or two.
This effect is more pronounced in certain situations. In hospital settings, blue dye added to tube-feeding formulas has been absorbed at higher rates in critically ill patients, producing blue or green discoloration of urine and even skin. For otherwise healthy people eating normal amounts of blue-dyed food, the color change is cosmetically surprising but not dangerous. Think back to whether you ate or drank anything with intense blue or purple coloring in the past 24 hours, including sports drinks, popsicles, brightly colored cereals, or blue cocktails.
Blue Diaper Syndrome in Infants
There is one rare genetic condition specifically named for this color change. Blue diaper syndrome occurs in infants who have a defect in how their bodies process tryptophan, an amino acid found in many foods. Bacteria in the gut break down the unabsorbed tryptophan into compounds called indoles, which are then excreted in urine. When those indoles hit the diaper and are exposed to air, they oxidize and turn blue.
Blue diaper syndrome is extremely rare and shows up early in life. Affected infants also tend to have diarrhea, high calcium levels in the blood and urine, and sometimes kidney problems. If you’re a parent noticing blue staining in your baby’s diaper and it can’t be explained by something in their diet, it’s worth bringing it to your pediatrician’s attention promptly.
Urinary Tract Infections
Certain bacteria can produce pigments that tint urine blue or green. The most commonly cited is Pseudomonas aeruginosa, a type of bacteria that produces a blue-green pigment as a natural byproduct of its metabolism. This is more common in people with urinary catheters or compromised immune systems than in the general population. If blue-green urine comes alongside burning during urination, cloudy or foul-smelling urine, fever, or pelvic pain, a bacterial infection is a real possibility.
What Your Doctor Will Check
If the color change doesn’t resolve within a day or two, or if you have other symptoms alongside it, a doctor will typically start with a urinalysis to look for bacteria, blood, or unusual compounds. Blood tests, including liver function panels, may follow to rule out metabolic causes. In some cases, imaging like an ultrasound of the kidneys and bladder or a CT scan helps rule out structural problems. A urine culture can identify whether a specific bacterial infection is responsible.
For most people, the diagnostic process is straightforward. Your doctor will ask about medications, recent procedures, and diet first. If one of those explains the color, no further testing is needed. The workup gets more involved only when there’s no obvious explanation or when the blue urine is accompanied by pain, fever, or other changes in how you feel.
How Long Blue Urine Lasts
When caused by food dye, the color usually fades within 24 to 48 hours as your body clears the pigment. Medication-related color changes persist as long as you’re taking the drug, though they resolve quickly after stopping. Methylene blue discoloration has been reported to clear within just a few hours once the compound is eliminated. If you stop the suspected cause and the blue tint doesn’t fade within two to three days, that’s a reasonable point to get it checked out, especially if anything else feels off.

