Warren Buffett's Berkshire Hathaway owns numerous stocks in its public equities portfolio. The largest positions rightfully get a lot of the attention, but there are smaller holdings that might make for great investment opportunities as well.

Take Mastercard (MA 0.07%). Even though it only accounts for 0.5% of the Oracle of Omaha's portfolio, its shares have seriously outperformed the broader market historically. Should you buy this magnificent Warren Buffett stock with $1,000 in 2024?

Here are three compelling reasons why you should, as well as one important factor that might make you hesitate.

Incredible financial performance

You'll see that the vast majority of Buffett's stocks are of businesses that produce solid financial results. But I think Mastercard stands out among the crowd.

The payments giant produced operating income of $3.8 billion in the third quarter of 2023. This represented a margin of 58%. That's outstanding on its own, but it's even more impressive that the operating margin has held steady at greater than 53% in each of the last 10 years.

It's not a surprise that the company generates a ton of free cash flow (FCF). From revenue of $18.6 billion in the first three quarters last year, FCF totaled $7 billion. Historically, management has used these proceeds to aggressively repurchase shares.

Powerful network effects

A term popularized by Buffett is economic moat, which is a set of characteristics that help protect a business from the threat of competition. Companies that possess a moat should be able to produce an outsize return on invested capital (ROIC) over the long term. Mastercard certainly fits the description.

In the last decade, the company's ROIC has averaged a superb 45%, indicative of a clear economic moat. In Mastercard's case, it benefits from powerful network effects. By operating a two-sided platform, with 3.3 billion debit and credit cards on one side and over 100 million merchant locations on the other, Mastercard's network gets more valuable to all its users the larger it gets.

It would be almost impossible for a new entrant in the industry to build a competing payments system. From an investment perspective, this reduces risk. There's less reason to worry that Mastercard will be disrupted.

Solid growth prospects

Another attractive quality about Mastercard is that it isn't done growing. This becomes evident if you look at even the most recent financials.

While many businesses struggled with macroeconomic headwinds that resulted in much slower sales gains, Mastercard continues its strong momentum. In Q3 2023, revenue grew 14% year-over-year to $6.5 billion. And this sum was 67% higher than the same period five years ago in 2018.

There's no reason to believe that Mastercard's gains will fall off a cliff. In fact, double-digit growth should be expected. That's because there's still a long runway for cashless transactions to proliferate across the globe in both developed and developing economies.

Consider the valuation

If all we cared about as investors was quality, then Mastercard is in an elite group of companies. But of course, the stock in question must also be selling for an attractive valuation. Here's where the picture might be less clear.

As of this writing, Mastercard shares trade at a price-to-earnings (P/E) ratio of about 38. While this is in line with its trailing-10-year average, it's a whopping 78% premium over the S&P 500. That's a steep valuation to pay, and it means that most people already think this is a wonderful business.

I believe the question of whether or not to buy the stock comes down to your assessment of the valuation. If you're OK paying that P/E multiple, then it makes sense to spend $1,000 to add this business to your portfolio.