Roasted whole coffee beans keep fairly well. The bean itself is a protective package, albeit a fragile one. Stored in a dry, airtight container to prevent contamination or contact with moisture, roasted whole-bean coffee holds its flavor and aroma for about a week. After two weeks, it still tastes reasonably fresh, but the aroma begins to slip; after three the flavor starts to go as well. Whole-bean coffee kept past a month, though still drinkable, will strike the palate as lifeless and dead.
But if the natural packaging of the bean is broken — that is, if the coffee is ground — it goes stale in a few hours. The delicate oils are exposed and immediately begin evaporating. An airtight container helps, but not much. The oxygen and moisture shut inside with the broken coffee destroy the delicate oils, even if you never open the container again.
Canning coffee is one of the useless gestures typical of convenience foods. Essentially, the natural coffee package, the bean, is broken down and replaced with an inefficient artificial package, the can. Furthermore, canned coffee is not only pre-ground, but pre-staled. Freshly roasted and ground coffee releases carbon dioxide gas. If the coffee were put in the cans fresh, the gas would swell even the strongest can and turn it into an egg-shaped time bomb. Various technological solutions have been found for this problem, but none is conducive to ensuring richly flavored coffee. When consumers break open the artificial package, they may find a coffee that is relatively fresh-but not for long. Since the small natural packages that make up a pound of ground coffee have already been broken, the oxygen that enters the can every time you peel off the plastic lid rapidly completes the job the canning process started.
So the easiest and most effective approach is to break down the beans as close as possible to the moment you want to use them — in other words, grind your coffee just before you brew it. Grinding coffee fresh takes very little time. Grinders are inexpensive and range from efficient electrics to picturesque replicas of old hand grinders. Grinding coffee fresh is the single best thing that you can do to improve the quality of your coffee.