Butter is a key part of most cake frostings, especially the classic buttercream. Both salted and unsalted butters can work in frosting recipes, but there are specific circumstances when you might want to choose one over the other.

Salted butter generally tastes better when served plain or in simple recipes, but it’s not always the best choice for frosting. The main disadvantage of making frosting with salted butter is that there’s no way to know how much salt is in it. Different companies add different amounts, and per tablespoon, you could be adding as little as 45 milligrams of salt or up to 115 milligrams or more. So if you use salted butter for buttercream or another type of cake frosting, your end product may turn out tasting much saltier than you’d like.

One advantage of salted butter is that it lasts longer than unsalted, since the added salt acts as a preservative. So if you very rarely buy or use butter, getting a package of salted may be the best choice. The shelf life of salted butter can also be a downside, however, since the salt in the butter can mask smells or flavors of rancidity.

Most cake recipes call specifically for unsalted butter because when you use it, you have total control over how much salt ends up in your cake and frosting. If a frosting recipe does not specify what type of butter to use, unsalted should be your 640 choice.

If it’s important to you to use the freshest ingredients possible, unsalted butter is also preferable because it doesn’t have the added preservative of salt and is usually fresher. That does mean, however, that your frosting will have a notable “off” taste if you use old unsalted butter that has gone rancid.

In a small survey conducted by “Good Housekeeping” magazine in 2013, most testers preferred the taste of cake and frosting made with unsalted butter and a recipe’s prescribed amount of added salt. Testers rated cake and frosting made with salted butter and no added salt lower, as well as cake and frosting made with salted butter plus the recipe’s added salt.

If you don’t typically buy unsalted butter, you can substitute salted butter in any cake frosting recipe. The sugar in the frosting will help cut the taste of the salt, but your frosting will still have a slight salty note to it. Both types of butter will create the same thick, creamy texture in a frosting.