Can you substitute margarine for vegetable oil?

In this article, we will answer the question “Can you substitute margarine for vegetable oil?”, and how long does margarine last?

Can you substitute margarine for vegetable oil?

Yes, you can substitute margarine for vegetable oil. Melt the margarine and estimate a 1:1 ratio for substitution. 

Can I use melted margarine in cake mix instead of oil?

The type of fat used in a baking recipe depends upon the type of product you are making. Most cake recipes call for butter, oil, or solid shortening to provide structure, volume, and moisture to the cake crumb. 

Cakes typically contain 15–25% fat on a batter weight basis. Fat in cake is usually derived from shortening, which assists in the entrapment of air bubbles into the cake batter during mixing and helps to leaven the product. In addition, shortening tenderizes the crumb, imparts moistness to the product and enhances mouthfeel. Cake shortenings are usually formulated from blends of processed oils and fats, which may be derived from vegetable, marine or animal sources. Although cakes can be made with oil, margarines, shortenings, butter or blends, studies showed that different types of fats have a great influence on the texture and flavor of baking (1).

The store-bought dry cake mix calls for the addition of wet pourable fat such as vegetables or cooking oil. However, you can also use melted butter or margarine instead. 

Cake mix basics 

Store-bought cake mixes only contain dry ingredients such as flour, sweeteners, and leavener. You only need to mix in the wet ingredients such as eggs, water, and oil to make the cake batter.

Eggs serve as the binding agent, water adds moisture while oil improves the texture of the cake crumb. The oil added to the mix contributes to the fat and moisture content of the batter.

The right ratio 

Pourable fat such as melted margarine can be substituted for melted butter in a 1:1 ratio. This means that you will replace every cup of melted butter called for in the recipe with a cup of melted margarine.

You can melt the margarine in the microwave or on a stovetop in a pan. The stovetop method will take a bit longer. Once the margarine is warm and melted, let it lose some of its heat as you do not intend to cook the eggs or the dry ingredients.

Choosing the right margarine 

It is important that you use real margarine for baking and not imitate stuff that goes by the name of margarine spreads. The composition of real margarine and margarine spreads differs greatly. As specified by the US Department of Agriculture, real margarine contains 80 percent fat in the form of oil, 20 percent water, and small amounts of solids such as salts.

When melted, real margarine looks just like butter. The margarine spreads, on the other hand, contain more water and less fat along with some other ingredients that improve its texture. These buttery spreads may contain as much as 40 percent water which deems them unsuitable for use in baking.

Baked goods made with the margarine spread turn out to be drier, tougher, and flat due to the high water content and the low-fat content of the spread.

A few more specifics 

The order of the addition of wet ingredients is not of much importance. But it is recommended to blend the dry and wet ingredients at a low speed initially. 

When the dry ingredients are just combined with the wet stuff, which takes about 30 seconds, you can increase the speed and whip the batter until creamy and lump-free. All the mixing needs to be quick or else the margarine will start to solidify in the batter.

Can you substitute margarine for shortening?

Yes, you can substitute margarine for shortening. Since margarine has a higher water content than shortening, you need to add a little more water when replacing shortening with margarine in a recipe. Depending upon the type of product you are making, you can try other substitutes for shortening as well.

As the texture of the cake depends on the ration among fat, sugar and eggs, changing the ideal proportions will change characteristics such as size and distribution of air bubbles in the batch. A high ratio of fat causes low value in springiness, cohesiveness and resilience but high value in gumminess with the cake microstructure of high mean cell area but low number of air cells per unit area (2). 

How long does margarine last?

The sell-by date printed on the label of margarine does not indicate its expiry. Margarine will not become unsafe or spoiled past this date. According to the US Department of Agriculture, margarine has a minimum shelf life of 6 months and must be stored at temperatures less than 10°C (50°F). In the freezer, it can be stored for up to 12 months. 

Sell-by is just an estimate of how long the store can keep the product on its shelves. The shelf-life of butter or margarine depends on its fat percentage, overall quality and how many preservatives it has.

What is the difference between butter and margarine?

The difference lies in their composition. The source of fats for butter is animal-based. For margarine, the source of fat is vegan. Butter has a high percentage of cholesterol and saturated fats, therefore, it stays solid at room temperature. 

Margarine has more unsaturated fats that are healthy and stay liquid at room temperature. Higher water content and unsaturated fats are what make margarine prone to spoilage.

Butter is an animal fat made from churning milk or cream, contains 80–81% butter fat, 16–18% water and 1–1.5% curd (protein, lactose and minerals) and 0–1.5% salt. Butter is popularity to use in cake products because of its sensory properties, nutrients value and naturalness of consumers’ mind. The creaming properties of butter are relatively poor and it may require the supplement with an emulsifier in order to get the best qualities. Margarine is made by partially hydrogenated soybean oil, has 79% fat, saturated fat and trans-fat content of 19.6% and 6.6% of total fat content, respectively. Margarine is water in oil emulsion with butter-like texture, adding salt, colorants and vitamins to provide sensory quality and nutritional value close to butter. The composition of margarine is similar to butter, but the mixture of oils, milk solid, water, salt and functionality of different margarine are various. Margarine may contain an emulsifier to aid the dispersion and stability of the water phase (2).


In this article, we answered the question “Can you substitute margarine for vegetable oil?”, and how long does margarine last?


  1. Matsakidou, Anthia, Georgios Blekas, and Adamantini Paraskevopoulou. Aroma and physical characteristics of cakes prepared by replacing margarine with extra virgin olive oil. LWT-Food Sci Technol, 2010, 43, 949-957.
  2. Pancharoen, S., Leelawat, B. & Vattanakul, S. Using texture properties for clustering butter cake from various ratios of ingredient combinations. Food Meas, 2019, 13, 34–42. 

Was this helpful?

Thanks for your feedback!