Microsoft (MSFT -2.45%) is not an easy stock to love right now. Redmond has underperformed (and thus held back) the Dow Jones Industrial Average (^DJI -0.98%) over the last decade, and it needed an epic post-earnings surge in April to stay apace with the Dow in a one-year time frame. Windows 8 is the most maligned Windows version since the disaster you know as Vista, and Microsoft found it hard to gain traction in the mobile market that's undermining its core desktop and laptop markets.

But when it comes to profit margins, Microsoft is still king of the court. I took a look at the top margin performers across the Dow in five important categories, and Microsoft kept coming back at the very top. The company landed in the pole position in three of the five most important margin categories, and it always ranked in the top three.

Starting at the top of the income statement, Microsoft's 75% gross margin fell behind American Express at 76% and Pfizer (PFE -3.85%) at 81%. As it turns out, the medical giant is Microsoft's main rival in the margin races; the names pair up time and again as we move forward.

Reading the headlines since the Windows 8 release, you might have thought Microsoft had already crashed and burned. But its gross margins have stayed remarkably steady, even as its most important product faltered. Meanwhile, Pfizer doesn't seem worried at all about the upcoming impact of Obamacare, as the company shows a rising pricing trend and strong gross income.

PFE Gross Profit Margin TTM Chart

PFE Gross Profit Margin TTM data by YCharts.

Things change a bit on the operating line, where Microsoft has been spending billions on research and marketing for several drastic product overhauls. On top of Windows 8's PR infusion needs, the company is also gearing up for the Xbox One launch later this year, not to mention the all-new range of Surface tablets that didn't factor into past fiscal years. Pfizer's gross profits trickle down to the operating line almost undiluted, though both trail the surging McDonald's (MCD -0.42%) operating profits. The fast-food king has diversified its menu in recent years without sacrificing its ultra-efficient operations. That's an impressive feat in any industry, and particularly so in a cutthroat consumer business like quick-service dining.

MSFT EBIT Margin TTM Chart

MSFT EBIT Margin TTM data by YCharts.

Pfizer wins the EBITDA battle with Microsoft. In terms of normalized net income, Microsoft ties for first place with megabank JPMorgan Chase at 22.3%. And when it comes to the most Foolish margin of them, all, Microsoft stands alone with a 29% free-cash-flow margin -- miles ahead of second-place performer Pfizer.

The takeaway here is that Microsoft might be down in the court of public opinion, but the company is far from out. Microsoft built an unmatched cash machine that a ham sandwich could run for decades before running out of mulligans. CEO Steve Ballmer is overdue for replacement, but the wheels will keep on turning until Microsoft's board can find a suitable replacement. These margins weren't pulled out of thin air, and they're too strong to crumble overnight.