Fresh coffee has a kind of magic to it—the deep, fragrant kind that fills a room and makes you pause before the first sip. It’s a small daily luxury, but one that depends almost entirely on freshness. That magic lives in a brief, golden stretch when the aroma blooms and the flavor still feels whole. Give it enough time or air, though, and even the best beans begin to fade, turning what was once bright and comforting into something flat.

Whether you keep a few bags tucked in the pantry or have cold brew concentrate chilling in the fridge, knowing how long each kind of coffee lasts can help every cup taste closer to that just-opened magic. Here’s what to expect from beans, grounds, espresso and beyond—and how to help each one hold onto its spark as long as possible.

How Long Whole Coffee Beans Last

This Is How Long Your Coffee Really Lasts Gettyimages 1389323000
Afriandi/Getty Images

A sealed bag of roasted beans can hold its flavor surprisingly well. According to the Specialty Coffee Association, roasted coffee packaged in low-oxygen, light-protected conditions may retain acceptable sensory quality for months, although exactly how long depends heavily on packaging and storage conditions. That said, most coffee roasters agree that whole beans—when properly packaged and stored—will last about a year before a noticeable decline in flavor happens.

Once opened, beans begin losing their best qualities quickly. Healthline reports that roasted beans taste their freshest for about one to three weeks after exposure to air.

Keep beans in a dark-colored, airtight container away from heat and sunlight—two factors that can significantly accelerate staling.

How Long Ground Coffee Stays Fresh

Ground coffee loses freshness faster than whole beans because so much surface area is exposed to oxygen. Lavazza notes that an unopened, vacuum-sealed bag usually stays fresh between five to six months. Once opened, though, ground coffee tastes its best for only one or two weeks.

It’s important to note that while many people prefer to store their ground coffee in the fridge or freezer, this can introduce condensation, which dulls flavor. Instead, keep your coffee in a cool cupboard or pantry in a dark-colored, airtight container.

How Long Brewed Coffee, Espresso and Cold Brew Lasts

Once coffee is brewed, time and temperature start shaping its flavor. Some types of coffee hold up longer than others, especially when dairy or cold-steeping comes into play.

Brewed black coffee

Freshly brewed black coffee tastes best within four hours at room temperature. After that, oxidation starts to dull the flavor, making the coffee taste flat or overly bitter. Healthline notes that while it may remain safe to drink at this point, the quality drops significantly. If you tend to brew extra coffee for later, storing it in a sealed container in the refrigerator will keep it drinkable for three to four days, though it won’t have the brightness of a fresh pot.

Coffee with milk or creamer

Once milk or creamer is added, the clock moves a lot faster. Dairy products fall under standard food-safety guidelines, so a milky coffee shouldn’t sit out for more than two hours. In the refrigerator, it’s usually fine for one to two days, but the texture can change slightly as the drink sits. If your coffee starts to taste sour, separates oddly or smells even a little off, it’s time to make a fresh batch.

Espresso shots

Espresso reaches its peak flavor almost immediately. The crema—the golden layer that carries so much of espresso’s aroma—begins to dissolve within seconds, and the shot starts losing its roundness and sweetness soon after. Even though it’s still safe to drink for hours, it simply won’t taste the same. Baristas often say espresso should be enjoyed within a minute or two of pulling the shot, when the crema, body and brightness are all in balance.

Homemade and bottled cold brew

Cold brew has the longest life of the brewed coffees because it’s steeped slowly and kept cold. According to Bazan Coffee, cold brew concentrate stays fresh for up to 14 days when properly sealed and refrigerated. Once diluted—or a store-bought bottled cold brew is opened—you’ll get about three to four days of good flavor. After that, acidity increases and the brew can taste a bit stale or sharp. Keeping it tightly sealed and consistently cold helps to extend its best days.

How to Tell If Your Coffee Has Gone Bad

Coffee doesn’t spoil the way milk does, but it does lose its spark. You’ll notice the shift first in the aroma—fresh coffee carries a lively, rich scent, and when that fades into something flat, papery or muted, the freshness has started to slip away. The flavor follows the same path, turning thinner and less vibrant as the days pass.

If your grounds have picked up moisture, they may clump or look a bit oily, and while visible mold is rare in dry, roasted coffee, it can appear if it’s been stored in a damp or humid spot.

Brewed coffee shows its age, too. A cup that tastes dull or leaves a chalkier finish than usual is past its prime. When the aroma softens and the brightness disappears, the coffee is telling you it’s time for a fresh bag.

Related: