Grind whole spices for freshness and flavor. Whole spices have four times the shelf life of ground spices because their seed coatings and barks protect their flavors, which aren't released until they are ground or heated. A coffee grinder devoted to spices makes grinding a snap, though you can also grind spices, especially small quantities, in a mortar and pestle.
Bottled five-spice powder can often be found at local supermarkets. However, if at all possible, I would recommend purchasing it from an Asian market. You'll pay less and the spice mixture will be more authentic.
Try toasting spices for an even deeper flavor. Whole spices work best for toasting because ground spices can burn easily. Some people like to roast their spices in the oven, but I like the control I get by toasting them on the stove where I can see them. Because spices burn easily, it's important to use a heavy-based pan over gentle heat. Shake the pan or stir the spices with a wooden spoon as they heat. They're ready when they become highly aromatic and turn slightly darker, which usually takes just a couple of minutes, but can take as long as five minutes, depending on the spice, the heat, and the pan.
Of course, these days the specific combination of spices used to make up five-spice powder varies. In fact, some brands could more accurately be labeled "seven-spice powder," since they contain seven ingredients. A standard recipe calls for fennel, cloves, and cinnamon, along with star anise and Szechuan peppercorns. However, you'll also find five-spice powder made with cassia (a member of the same family as cinnamon), ginger, nutmeg, and even licorice (star anise has a wonderful licorice flavor).