In general, it is possible to use margarine for baking if it is authentic margarine with a high enough fat content. Real margarine can be substituted in equal amounts for butter, although it will provide a different taste to the baked dish. There are several modified or mixed versions of margarine that might not be suitable for baking, however, mostly because they do not have enough fat to cause the necessary reactions in foods and because they have a high water content. It is best to avoid non-fat margarine for baking, as well as products that are packaged as margarine but are labeled as spreads or substitutes. Margarine has different properties than butter so, when using margarine for baking, it can be beneficial to freeze it before creaming, be extra cautious when melting it and be aware of any additives such as flavorings that might have been added during manufacturing.
True margarine is made primarily of fats that are derived from vegetable oils. The definition of "real margarine" is that it must contain at least 80 percent fat, making it equivalent to butter in that regard and making it possible to use margarine for baking almost any type of food. Puff pastry and syrup-based candies are two exceptions unless the recipes have been specifically developed to use margarine. The amount of fat in margarine is sometimes reduced to make a low-fat or non-fat product that might — or might not — be appropriate for baking. In general, margarine that has a fat content of more than 50 percent can be used for baking.
If the amount of fat is reduced in margarine, then it frequently is replaced by water. When using margarine for baking, excess water can quickly turn a batter or dough into a very soupy mess and, thus, should be avoided. Some recipes account for the extra water in non-fat margarines and adjust the remaining ingredients accordingly. In these cases, using higher-fat margarine for baking can result in a batter that is too dry.
If a recipe calls for the margarine to be creamed or whipped with sugar, then it can be done more easily if the margarine is first partially frozen. This will help it to retain its structure while being whipped. Additionally, the melting point for margarine is lower than that of butter, meaning margarine will melt more readily. Some margarine has additives such as flavorings or salt that can affect the taste of the final dish, so choosing the appropriate margarine for baking may involve being aware of its ingredients.