The question of coffee’s shelf life is a bit complicated, because it depends if you’re seeking its peak flavor or just when it’s still “safe” to drink. When it comes to whole bean, “to get the best out of the coffee, the first month after roasting is the most optimal time,” says Nyamumbo, “After that, it deteriorates gradually but how it’s stored can affect how long it maintains freshness.”
Another factor at play is the origin of the coffee, because the longer you wait after roast date (which most speciality coffee brands will put on the packaging) the more flux there may be to the flavors. “I drink Kenyas, which tend to be bright—and that acidity fades over time, which is different but not necessarily bad. Some coffees age pretty well.”
The real outer limit for whole bean coffee is a year—anything over that will likely have lost it’s distinctive characteristics, “I am not sure if there is a shelf life limit as I have seen expiration dates at the grocery store that were two years out,” Nyamumbo did say.
As previously stated, ground coffee is going to loose it’s punch a lot faster. “Once ground, flavor loss accelerates and coffee can lose freshness in a matter of hours, unless it’s instantly preserved in an oxygen-free package,” she explained.
“The science behind it is that grinding increases the surface area of the coffee and the CO2 escapes rapidly—upsetting the balance needed to produce the right aromatics.” Once those aromatics are gone, you may still get a nice cup of coffee, but it won’t be as full flavored and you won’t get as much of that wonderful morning coffee smell.