To many people, Visa (V -0.23%) and Mastercard (MA 0.07%) are synonymous. Both companies are well-known brands, owning and operating payment networks that facilitate billions of credit card transactions around the world. Millions of people have a Visa or Mastercard logo in their pocket right now.

The similarities continue from an investment standpoint. Mastercard went public in mid-2006, with Visa following suit in early 2008. The stocks then went on a huge run, both rising roughly 2,000% in value.

There is little doubt that these companies run fantastic businesses -- just look at their historical returns. If you want to take advantage with your own investment, which stock should you buy today? The answer might surprise you.

Network effects win big

The first thing to understand about Visa and Mastercard is that both owe their success to network effects. That is, the more people that use their services, the more valuable their businesses become.

While both businesses now offer ancillary services like cross-border transactions and risk-management solutions, the core moneymaker for them has always been consumer payments. Whenever you swipe, insert, or tap your credit card or enter its numbers -- whether it be at a physical store or online webpage -- there is an invisible process that plays out that ensures each party pays and gets paid accordingly. Very often it is Visa or Mastercard that takes on this role, keeping a small slice of the transaction price as a fee.

When it comes to market share, Visa and Mastercard dominate. In 2022, there were around 830 million general purpose credit cards in circulation in the United States. Visa was responsible for 385 million of those, with Mastercard contributing another 309 million. The next two card issuers on the list, Discover and American Express, were responsible for only 162 million combined.

There are two reasons for this market share dominance. First is the aforementioned power of network effects. Customers want to shop where their method of payment is accepted and merchants want to accept the method of payment most people have. This is called a two-sided marketplace, the dynamics of which often consolidate market share to only a few competitors.

The second reason Visa and Mastercard dominate the market is that both brands command trust. The networks of these companies rarely make mistakes. Their networks just work. This reality is backed by numbers. Visa, for example, facilitated $14.8 trillion worth of transactions in 2023. That's up from $14.1 trillion in 2022, and $13 trillion in 2021. Mastercard, for comparison, handled $9 trillion of transactions in 2023, compared to $8.2 trillion in 2022.

Each time these businesses grow, they become even more powerful, becoming more entrenched as a market duopoly. According to the numbers, that trend is nowhere close to stopping.

But what about the stocks?

Visa and Mastercard are terrific businesses with strong moats, but does that make the stocks worth investing in? On the surface, shares look very expensive, but there's more to understand about this story.

Right now, Mastercard stock trades at 39 times earning, with Visa stock trading at 32 times earnings. That's a 40% to 70% premium versus the average S&P 500 stock.

Looking at the forward price-to-earnings ratios, however, which measure how expensive a stock is compared to estimates of next year's earnings, the valuations don't look nearly as bad. On a forward price-to-earnings basis, Visa and Mastercard trade at only 5% to 20% premiums to market's current valuation.

MA PE Ratio Chart

MA PE Ratio data by YCharts

The reason that Visa and Mastercard look much cheaper on a forward price-to-earnings basis is that earnings are growing so quickly. Over the past five years, annual earnings growth for both companies has averaged between 12% and 17%. For this reason, the pricey upfront multiple has historically become a bargain within a year or two.

So which stock is the better buy today? The answer is that it pays to own both. Both Visa and Mastercard are fully entrenched as the market duopoly. And while shares of both trade at high multiples, these figures should soon look like bargains for anyone with a multiyear investment window. If you want to buy into blue chip businesses with long runways for sustainable growth, consider buying both.