What's the significance of 1986? It's the year Microsoft (MSFT -0.88%) stock first listed on the public markets. During its early years, the company was heavily focused on software for personal computers, such as its Windows operating system and Microsoft Word.

But so much has changed since then. Today, Microsoft is a raging success across not only software, but also hardware, gaming, and even cloud computing. 

That hunger for expansion has led to a soaring stock price over the last 36 years, and Microsoft's early investors are certainly sitting pretty today, even despite the company losing 28% of its value in 2022 amid the tough economy.

Here's exactly how much those investors have been rewarded for their patience.

Windows, Office, Azure, Xbox, and Surface

Those are just a few of Microsoft's most recognized brands. It's a quintessential consumer-products company, with Windows and Office adopted by billions of users globally. But in 2022, its consumer segments haven't performed very well, with a gradual decline in engagement and revenue across its Xbox gaming ecosystem, and softening sales of its Surface line of laptop computers and tablet devices.

Plus, it's currently trying to acquire game development studio Activision Blizzard for $69 billion, but the U.S. Federal Trade Commission has sued Microsoft to block the deal. The government is concerned it would concentrate too much market power in the hands of Microsoft, because the company could theoretically reserve top games for the Xbox platform while locking out its competitors.

But while that battle rages on, the company continues to experience rapid growth in its cloud services segment. Azure is a cloud platform that serves businesses, enabling their digital transformation whether they need to develop software, build databases, or even access advanced machine-learning tools.

Azure's revenue grew by 35% year over year in the recent first quarter of fiscal 2023 (ended Sept. 30), which was three times the pace of Microsoft's overall revenue growth of 11%. And the company might still be in the early innings of this opportunity, since the cloud industry is expected to be worth $1.5 trillion annually by 2030, tripling from $483 billion in 2022, according to Grand View Research.

Microsoft has been unstoppable over the long run

Inflation and rising interest rates are hurting consumers' spending power right now, so parts of Microsoft's business might continue to deliver sluggish growth in the short term. But there have been some early signs that those headwinds are easing, so 2023 might be a more favorable time for brands like Xbox and Surface.

But Microsoft is, and always has been, a long-term story. When the company listed publicly 36 years ago, it was generating just $197 million in annual revenue. By fiscal 2022 (ended June 30), that figure has grown by 1,000 times to $198 billion. 

Sure, there have been some bumps along the way, with the company's growth taking a breather in certain years like 2009 (during the financial crisis), but the chart below shows a very clear trajectory.

A chart of Microsoft's annual revenue since 1986.

Value of a $1,000 investment in Microsoft's IPO today

Microsoft completed its initial public offering (IPO) on March 13, 1986, at a price of $21 per share. Since then, the company has grown so valuable, and its stock price has soared so high, that management opted to conduct nine stock splits over time to ensure its shares remained accessible to small investors.

Had you invested $1,000 in Microsoft at its IPO, you would have acquired 47 shares at $21 per share. Adjusting for the stock splits, you'd actually have 13,536 shares today with a cost basis of $0.0729 per share. 

Given Microsoft now trades at $238.73 per share, that translates to a return of 327,401%.

In dollar terms, that $1,000 investment in 1986 would be worth a whopping $3.23 million today. But it gets better, because Microsoft has paid a dividend since 2003 -- and assuming you never sold a single share along the way, you'd have also received $341,513 in dividends.

Given Microsoft continues to pay a quarterly dividend of $0.68 per share, you would still be collecting a cool $36,817 each year, or 36 times your initial $1,000 outlay. That's the power of long-term investing.

Is Microsoft stock still a buy today? It operates in so many diverse, transformative industries serving both consumers and businesses that the stock likely remains a safe bet over the next decade and beyond. Since it has declined by 28% in 2022 amid the weak economy and broader stock market sell-off, this might be a great chance to buy.