If your pee smells like coffee not long after you drank coffee, the coffee is the most likely explanation.
Your body absorbs the compounds in coffee, breaks them down, and sends some of them and their byproducts out through your urine. The smell on its own is generally not a sign that anything is wrong.
It's more useful as a timeline clue than a health signal: "I had two cups this morning and noticed it at noon" is a far better explanation than hunting for a rare disease based on an odor. Here's why it happens, how to confirm coffee is the cause, and the few situations where the smell is worth a second look.
Why your pee may smell like coffee
Coffee contains a lot of different compounds, including caffeine, chlorogenic acids, and hundreds of others from the plant. When you drink it, your body absorbs and transforms many of them, and your kidneys clear some of the results into your urine. Researchers can identify coffee consumption from characteristic metabolites that show up in urine. That confirms coffee leaves a measurable chemical trail, though it doesn't tell us which compound, if any, produces the recognizable smell.
Coffee sends a range of its byproducts into your urine, and for some people the result smells a bit like coffee. But there's no single proven "coffee-smell chemical," and you don't need one to explain what you're noticing. A coffee-like smell is just one of several odors urine can take on, like a popcorn note or something fishy, each with its own reasons.
Why some people notice it more
Whether you notice it at all seems to come down to a few things: how much coffee you drank, how strong it was, how recently, how sensitive your nose is, and how concentrated your urine happens to be. These are reasonable contributors rather than precise predictors, so it's not worth reading much into exactly how strong it is on a given day.
Concentration is the one worth understanding. Urine is mostly water carrying dissolved waste, so when there's less water and more waste, the color is darker. Concentrated urine often has a stronger overall odor too, so it's reasonable to think it could make a coffee-like note easier to notice, though that specific effect hasn't been studied directly. Color is part of what your pee can tell you.