The stock market has a stellar track record of creating wealth, even for investors who simply bought an index fund and held for the long term. But investors willing to take a chance on individual stocks have in some cases absolutely crushed the return of the broader market.

Microsoft (MSFT 0.59%) was founded in 1975. It went public 11 years later in 1986 with a market valuation of just $777 million. Today it's worth a whopping $2.7 trillion, making it the second-largest company in the world.

Investors who bought Microsoft stock at its IPO and held until now would be sitting on a capital gain of 506,265%. In other words, a mere $200 invested back in 1986 would be worth $1 million today.

Two people laughing as money falls down on them from above.

Image source: Getty Images.

Microsoft has a storied history of innovation

Microsoft developed the operating system for IBM's first personal computer in 1981. That paved the way for Windows, which launched in 1985, and has become the most popular PC operating system in the world. Today it boasts at least 1.6 billion users, with a 64% market share.

Microsoft built many successful software products on top of Windows over the years. Office is one of the most famous, and it was launched in 1989. It's known as Microsoft 365 these days, and it features popular applications like Word, Excel, and PowerPoint, among others.

The company has also gone after its longtime rival, Apple, in the hardware space a few times. It designed the Zune digital media player to compete with the iPod, and it also released a few cellphones over the years. Unfortunately, none of them really stuck.

But Microsoft is certainly having success in the hardware space today. Its Xbox game console is one of the hottest products in the world, and its Surface line of notebook computers and tablet devices is incredibly popular with consumers (myself included).

But cloud computing has been Microsoft's most lucrative business so far. Its flagship platform, Azure, was launched in 2010 to help developers build and run applications online. Today Azure offers hundreds of services to empower businesses to thrive in a digital world, from simple data storage to operating sales channels to hosting mission-critical software.

The future might be driven by artificial intelligence

The cloud continues to evolve, and it's paving the way for powerful new technologies like artificial intelligence (AI). See, to offer such a wide range of services to businesses, cloud providers like Microsoft need to maintain enormous, centralized data centers for their customers to use.

Since AI requires a substantial amount of computing power, most businesses can't afford to build the infrastructure they need to develop the technology themselves. Therefore it makes sense for experienced cloud providers to absorb that responsibility by building data centers at scale, powered by advanced chips from producers like Nvidia.

That's exactly what Microsoft has done. It also invested $10 billion in ChatGPT developer OpenAI earlier this year, and it offers the start-up's latest GPT-4 models to Azure customers in the cloud. A combination of computing power and pre-built models empowers businesses to develop their own AI applications for a fraction of the cost of building those inputs themselves.

So far, Azure OpenAI Service has attracted 18,000 corporate customers, from practically zero at the beginning of 2023.

Microsoft also integrated ChatGPT into several of its software products, including Windows, 365, the Edge internet browser, and the Bing search engine. It also launched Copilot for enterprises in August, which gives businesses access to AI-powered features in applications within 365 to enhance productivity. It costs $30 per user per month, and it could be extremely lucrative long-term because large organizations tend to have hundreds of thousands of employees.

Microsoft could make more millionaires over the long term

To be frank, Microsoft stock's largest gains are in the rearview mirror. It's unlikely $200 invested today will grow into $1 million in another 37 years the same way it did in the last 37.

The law of large numbers makes it harder for a company of Microsoft's size to grow at the same pace it did in the past. Given that flagship platforms like Windows and 365 already have billions of users, the world's population would have to increase substantially for the company to replicate its success.

For example, Microsoft generated $211.9 billion in revenue in fiscal 2023 (ended June 30), and it's expected to grow by just 14.8% in fiscal 2024 to $243.2 billion. By comparison, Microsoft's revenue increased by 75% in 1987 -- but the company only brought in $345 million, so it was much easier to grow.

With that said, millions of dollars might still be on the table for patient investors. It just means they have to start with a larger outlay.

For example, $100,000 could grow into $1 million within 20 years if Microsoft stock increases by 12.2% per year going forward. That's entirely possible considering it has gained an average of 25.9% every year since 1986 -- so even if that growth rate halves, it will still be enough.

Artificial intelligence is the big wild card. It has substantial potential; depending which Wall Street forecast you rely upon, it could add anywhere between $7 trillion and $200 trillion to the global economy over the next decade. Given Microsoft is already an industry leader, it stands to drive a chunk of that value, which could accelerate the company's growth.

It certainly isn't too late to invest in Microsoft, and it could still make plenty of millionaires over the long term.