Margarine is healthier than butter because it is lower in saturated fat.
Early margarines contained trans fats, which are more harmful than the saturated fat in butter. Modern margarines have improved but are still highly processed. Butter in moderation is now considered acceptable by many nutritionists.
What changed?
Margarine arrived in American homes in the postwar era with a health halo. Here was a modern food product, engineered rather than animal-derived, lower in the saturated fat that nutritional science was increasingly blaming for heart disease. Butter was old and artisanal and implicated in cardiovascular mortality. Margarine was new, scientific, and safe. The American Heart Association recommended it. Physicians suggested it. Families made the switch.
The irony was almost total. The hydrogenation process that turned liquid vegetable oils into solid margarine, the process that gave margarine its shelf stability and spreadability, produced trans fatty acids as a byproduct. Trans fats turned out to be considerably more damaging to cardiovascular health than the saturated fat in butter they were replacing. Trans fats raise LDL (bad) cholesterol and simultaneously lower HDL (good) cholesterol. Saturated fat raises LDL but does not lower HDL. On the relevant metric, margarine was worse.
The evidence against trans fats began building in the early 1990s. Walter Willett's research group at Harvard published a landmark 1993 paper in The Lancet showing that trans fat intake was positively associated with risk of coronary heart disease in the Nurses' Health Study cohort. Subsequent research confirmed and extended the finding.
The FDA required trans fat labeling on food products beginning in 2006. By 2013, the FDA had tentatively determined that partially hydrogenated oils, the primary source of industrial trans fats, were no longer generally recognized as safe. The full ban on partially hydrogenated oils in food manufacturing took effect in 2020.
Modern margarines have reformulated: they now use interesterified fats or fully hydrogenated oils blended with liquid oils, avoiding the trans fat problem while maintaining spreadability. Whether these replacements are entirely benign remains an active research question. The newer margarines are probably not worse than butter, and may be comparable.
The butter-margarine story is often cited as an example of nutrition science's instability, proof that dietary advice is unreliable. The lesson is more specific: a plausible hypothesis (saturated fat is harmful) was applied to a specific intervention (replace butter with margarine) without adequately investigating what margarine actually did in the body. The error was not that nutritional science is hopelessly uncertain. It was that certainty was assumed before the evidence warranted it.