My mother loves butter. It is the primary fat I ate growing up. She smeared it on any kind of bread, potatoes, nut rolls or coffeecake. She baked with it exclusively.
When I was studying nutrition in college, I had a teaching assistant who recommended margarine over butter. I was shocked – and wondered about the difference between the two. It was one of the things that sparked my interest in food science. Today, I am a food scientist and study how foods such as butter and margarine can have subtle chemical differences, with a big impact on how they act in food.
Chemical structures
Butter and margarine are emulsions, which are mixtures of tiny water droplets spread throughout a continuous fat matrix. This matrix is made mostly of triglycerides, the primary form of fat in our diet.
Fatty acids are long chains of carbon surrounded by hydrogen atoms. In a triglyceride, there are three fatty acids, each one connected to the same three-carbon glycerol molecule, which acts as the backbone of the molecule. While the backbone is always the same, the number of carbons in the fatty acids can vary. In cream, triglycerides are packaged into globules or crystals.
Innerstream/Wikimedia Commons
Both butter and margarine have a combination of saturated and unsaturated fatty acids. However, butter’s are mainly saturated, which makes them fit together and stack compactly to form a nice straight chain, because they have no double bonds between the carbons.
Margarine’s fatty acids are mainly unsaturated, from blended plant oils. The unsaturated fats give them an irregular shape on a molecular level. The double bonds between carbons kink the molecule so they cannot be as neatly arranged. This difference affects how they melt.

Jü/Wikimedia Commons
There are many forms of fat crystals in butter, and they have different melting points. These crystals make butter very firm at cold temperatures and allow it to soften gradually at room or body temperature. They also trap air easily when creamed together with crystalline sugar, which adds lightness and porosity to baked goods.
Both butter and margarine are at minimum 80% fat, though some butters are closer to 85% fat. Their water content hovers around 16%, and butter is made up of 1-4% vitamins, minerals, lactose and protein.
Butter has an official standard of identity set forth by the U.S. government, which means manufacturers must meet specific guidelines for their product to be considered butter. This food standard is one of the oldest in the U.S.
Making butter
When you shake or churn cream, fat globules rupture. The fat leaks out and forms semi-solid grains of butter. With more shaking or churning, these grains grow and separate from the watery, naturally low-fat buttermilk.

Rupendra Singh Rawat/iStock via Getty Images
You then collect, knead and press the mass and, voila, you have butter. Some butter is cultured by adding lactic acid bacteria. These bacteria ferment milk sugar, or lactose, into flavor compounds and organic acids, which give the butter a mild tang and complex flavor.
Sweet butter is easy to make at home if you add cold, heavy cream with a fat content of at least 36% to a standing mixer with a whisk attachment. Turn it on and walk away for a bit, and when you hear the sloshing sound of watery buttermilk, you know you have butter ready for pressing.
Making margarine
Sticks of margarine start as liquid, plant-based oils and are made into a solid. Producers chemically rearrange fatty acids on the glycerol molecule in a modification process called interesterification, which makes the oil solid and the fats more uniformly distributed.
This process rearranges the triglycerides in margarine without adding saturated fats or creating trans fats. Trans fats have been banned in many countries because of their association with cardiovascular disease and higher cholesterol.
Interesterification allows margarine to stay solid longer when baking, with a more precise melting point.
Spreads or squeeze-style margarines do not go through this process and instead rely on higher ratios of water and air to solid oils, which keep them soft and spreadable. These spreadable types are lower in fat, so they don’t work well for baking. The higher water content alters the texture, and most baking recipes are formulated assuming a higher percentage of fat.
Processors are not required to state on the label whether margarine has gone through interesterification.
Flavor and color
Butter gets its golden color from beta-carotene, an orange pigment present in grass. Cows eat the grass but do not metabolize beta-carotene efficiently, so it is expressed in their milk. Margarine is naturally colorless, but producers add synthetic beta-carotene to it to mimic the color of butter.
Margarine producers also add flavors such as diacetyl, a distinctive butter-flavor molecule, and blends of whey components and preservatives to replicate the flavor of butter. They may add emulsifiers such as lecithin or monoglycerides to keep the water and fat from separating. The exact ratios of ingredients vary between producers.

Jeffrey Greenberg/Universal Images Group via Getty Images
Chemical differences can translate into subtle health differences. While both are mainly made of triglycerides, the fats in butter are naturally occurring, while fats in margarine are industrially modified. This difference makes margarine an ultraprocessed food, but it also means it has fewer saturated fats. While you might have health reasons for choosing one over another, take note that the chemistry behind how these fats are made also can influence how they behave in the kitchen.
Baking differences
When you heat butter, the proteins and lactose in it combine, creating that signature brown color and a delicious nutty, toasty, caramelized flavor. Because margarine doesn’t contain lactose, it won’t brown as well as butter, nor will it impart the same level of aromatics.
When baked in a very hot oven, butter contains enough water to form steam, which separates doughs into layers of flaky pastry. Water content varies in margarine, and while it forms some steam, it will not perform as well as butter.
However, margarine has some advantages over butter. It’s very consistent and melts in controlled way. It also has a longer shelf life. Yes, you can use them interchangeably, but knowing functional differences between the two can help you determine when to use which.
