If you ran out of either butter or shortening, want to use up a package, or simply prefer the texture or flavor of one over the other you can substitute butter for shortening and shortening for butter in your baked goods. Be wary that the end result will be a bit different depending on which fat you use because they are fundamentally different products.
There is no magic shortening to butter conversion, generally, you can use butter or margarine in place of shortening as a one-to-one swap. Making this substitution may slightly alter the texture of your baked goods. When substituting butter for shortening, use the same amount called for in your recipe.
Related: Butter substitutes beyond shortening
Shortening is 100 percent fat. Butter and margarine are about 85 percent fat and 15 percent water. This additional liquid may change the consistency of the sweets you bake. Butter and margarine's rich, pleasing flavors and texture usually make a desireable substitute though.
Do not use whipped butters, margarines, or blends in baking.
On the rare occasion that you run out of butter (how could you let this happen?!), shortening with a little salt makes an excellent fat substitution.
If a recipe calls for:
Adding the optional salt will give you more of a salted butter result than unsalted butter.
Tip: If you've got open packages of both shortening and butter, you can use a combination of the two in your baking. Just combine to measure the amount called for in your recipe.