One of billionaire investor Warren Buffett's biggest mistakes was not buying shares of Microsoft (MSFT -2.45%) in the company's early years. He blames not doing it on "stupidity," as the business has proven to be a huge success. Even buying the stock five years ago would have more than doubled your money. The tech stock has simply been a great buy -- but 2022 was a big exception.

Last year was the first time Microsoft didn't outperform the S&P 500 since 2012

Microsoft is one of the safest growth stocks you can buy and it normally has no problem outperforming the markets. But in 2022, amid a big tech sell-off, its shares fell by 29%, which is far worse than the S&P 500's decline of a more modest 19%. Here's a quick overview of how Microsoft has performed against the index:

Data source: YCharts. Chart by author.

It's an incredible performance for the stock but with Microsoft being a hugely profitable business (its net margins are north of 30%) and always finding new ways to grow, its success shouldn't be too big of a surprise. 

Will Microsoft outperform the markets in 2023?

A large sell-off for Microsoft's stock is a rarity, and a stronger year could be possible in 2023 because its valuation is starting from a lower price point. And in terms of its price-to-earnings multiple, the stock is trading at a discount compared to its five-year average:

MSFT PE Ratio Chart

MSFT PE Ratio data by YCharts

Although Microsoft's stock looks relatively cheap, that doesn't mean it's a lock to beat the markets this year. Investors have been shifting away from growth stocks amid fears of a recession. And as businesses may cut back on spending in tougher times, that could adversely impact Microsoft's sales. And the company's growth rate has been falling in recent quarters and it's now at a five-year low:

MSFT Revenue (Quarterly YoY Growth) Chart

MSFT Revenue (Quarterly YoY Growth) data by YCharts

Another factor that could weigh on the stock is Microsoft's pending acquisition of gaming company Activision Blizzard. Regulators are attempting to block the deal, and how that plays out and whether it gets resolved or not this year could impact the stock. Adding the business, which owns the Call of Duty and Warcraft franchises, would give Microsoft a significant growth opportunity in its gaming business and could make growth investors more bullish on its prospects.

Regardless of what happens this year, Microsoft's stock is a buy right now

Whether or not Microsoft's stock beats the market this year isn't important. In the long run, it's likely to outperform given the business's sound financials and diverse revenue sources, including LinkedIn, Windows, Azure, Xbox, and Office 365. Buying the stock today could be a once-in-a-decade buying opportunity