Baking powder may no longer work long before its "use by" date if not stored properly. The way baking powder works is that it mixes carbon dioxide gas into the dough or batter of baked goods, acting as a leavening agent. Baking powder will harden in its packaging if it is exposed to moisture. Hardened baking powder is ineffective because the desired carbon dioxide release has already occurred. The best defenses against hard baking powder are a good container and smart storage.
The Right Container in the Right Place
Keep baking powder in an airtight container made of glass, metal or plastic. Once in the container, only dip dry utensils into the container to avoid adding any moisture, and reseal the container quickly after removing any baking powder. Some baking powders already come in airtight containers -- though if the container is cardboard, transfer the baking powder into a sturdier container that won't absorb moisture like cardboard will. Store baking powder in a dry area near room temperature to ensure that the powder will stay soft longer; do not refrigerate the container because that will expose the powder to moisture. A simple way to test if baking powder is still good is to add a teaspoon to about 1/3 cup hot water; if the baking soda starts to bubble, then it will still work in your recipes.