Although they now sit side by side in the dairy aisle, the relationship between butter and margarine has been anything but smooth.

Case in point: The production and sale of margarine was once banned in several states, including Maine, Wisconsin, and Ohio, for fear that it would be marketed as “real” butter. And then, of course, there’s the debate that’s raged for years of whether butter or margarine is better for you.

While they may look indistinguishable once slathered on toast, a bit of investigation reveals that the differences between these two savory spreads abound. So what exactly differentiates butter and margarine, and is one a clear winner for health and taste?

The difference between butter and margarine’s ingredients is pretty straightforward. Butter is a dairy product made from milk or cream (which, incidentally, makes homemade butter surprisingly easy), while margarine’s key ingredient is vegetable oil.

Civilizations across the globe have been enjoying butter from various animals’ milk for millennia. The original margarine formula, on the other hand, was invented by a French chemist in 1869 as a butter substitute. A cheaper alternative to butter, it arrived in the U.S. in the 1870s, much to the dismay of the dairy industry.

As margarine companies popped up left and right, pro-dairy lobbyists fought the changing tides with efforts to impose restrictions, taxes, and licensing fees on the new margarine producers.

Butter is naturally yellow, since most butter-producing cows munch on grass that’s rich in the pigment beta carotene. This pigment is bound inside milk’s fat, so when cream gets churned, leaving liquid behind, the pigment becomes exposed.

Surprisingly, un-dyed margarine is actually white. When early margarine producers started adding yellow dye to the mix in order to position their product as a substitute for butter, the dairy industry sprang into action.

At one point, 32 states enacted restrictions on the dyeing of margarine. Three went so far as to demand that margarine must be dyed an unsettling shade of pink.

To this day, restrictions around dyed margarine can still be found in Wisconsin law, including this selection from Statute 97.18: “The serving of colored oleomargarine or margarine at a public eating place as a substitute for table butter is prohibited unless it is ordered by the customer.” Yowza.

Since butter is an animal product, it contains saturated fats and cholesterol. While margarine typically has less saturated fat and cholesterol than butter, it historically contained trans fats.

These trans fats were a byproduct of the process known as hydrogenation, in which hydrogen was added to vegetable oils to make them semi-solid (instead of liquid) at room temperature.

In response to growing evidence that trans fats pose a serious threat to heart health, margarine producers were faced with reworking their formulas. Beginning in January 2006, the Food and Drug Administration (FDA) called for the required labeling of trans fats on food packaging.

Then in 2015, the FDA went so far as to call for the elimination of trans fats in American food production by 2018. They then extended the deadline to January 1st, 2020 (and January 1st, 2021 for products containing them to cycle through the food system).

These days, most margarine containers boast zero grams of trans fats, thanks to a different process known as interesterification, which creates the signature smoothness without adding harmful fats.

Here’s a look at how butter and margarine compare nutritionally:

1 Tbsp. (14 g) unsalted butter1 Tbsp. (14 g) unsalted margarine
Fat11.5 g11.5 g
Saturated fat7 g2 g
Protein0 g0 g
Carbohydrates0 g0 g
Sodium1 mg0 mg
Calcium3 mg0 mg

While both margarine and butter contain roughly the same amount of calories per serving (about 100 calories per 14 grams), it’s worth noting there are different types of margarine. Check labels carefully to make sure you know what you’re getting.

Thanks to its lower price point and a longtime reputation as a healthier alternative to butter (for its lower saturated fats and cholesterol and zero animal fat), vegetable oil-based margarine spent many years in the sun.

But as new information arises and a preference for natural products prevails, butter looks to reclaim the top spot in consumers’ hearts. As a 2017 headline from The Economist put it: “Margarine sales: investors can’t believe they’re not better.”

The healthfulness of your butter might also come down to the diet of the cows used to provide its milk. Grass-fed butter contains more omega-3 fatty acids and conjugated linoleic acid (CLA) than grain-fed. Both of these fatty acids have been linked to health benefits, including reducing inflammation and promoting heart health.

So which is right for you, butter or margarine? The answer will probably depend on your diet (margarine is vegan), recommended fat intake, and other health goals. A cardiologist will probably tell you margarine (with no trans fat and low saturated fat) tops butter for heart health, while 99% of chefs will tell you nothing beats real butter.

The final burning (or melting) question: Can you use butter and margarine interchangeably? Simply put: yes!

Whether cooking or baking, butter and margarine can be swapped one at a 1:1 ratio — but you’ll often notice textural and flavor differences. For some, they’re minor enough not to matter, and others actually prefer the effect margarine has on a cake or cookie recipe. So head to the kitchen for your own creamy culinary face-off.