Visa Inc. (NYSE:V) and MasterCard (NYSE:MA) aren't the only two players in the credit card and electronic payments space, but they are the biggest and best-known. Both Visa and MasterCard have extended their reach across the globe, and both have high expectations in their trajectories for future growth. Yet after a big push in the stock market that has sent both of these financial stocks to all-time highs, investors need to know which of the two leaders in the card industry is more deserving of their attention. Let's take a closer look at Visa and MasterCard, comparing them using several different metrics to see which company's shares are the better buy.

Valuation and stock performance

Visa and MasterCard have both enjoyed big returns over the past 12 months. Since February 2016, Visa is up by 23% and MasterCard has managed to outpace its larger counterpart with a 27% total return.

MasterCard corporate credit card.

Image source: MasterCard.

Despite MasterCard's slightly larger share-price gains, it has managed to sustain at least a small valuation advantage over Visa when you use earnings as a guide. Based on what they've earned in profit over the past 12 months, Visa currently trades at 34 times trailing earnings, while MasterCard has an earnings multiple of just under 30.

However, that advantage narrows considerably when you incorporate near-term expectations for future growth. MasterCard's forward multiple is 22, and that's only slightly less than Visa's corresponding valuation of 23 times forward earnings. MasterCard has stronger momentum, but any valuation advantage it has is relatively modest.

Dividends and capital allocation

High-growth companies often take as much of their capital as they can and use it for internal investment, giving dividend investors only small payouts. That's been the case for Visa and MasterCard for a long time and continues to be the case. Visa currently has a dividend yield of 0.75%, and MasterCard weighs in with a 0.8% yield.

Both companies have made efforts to boost their dividends, but their low base has made it tough to make much progress. MasterCard gave investors a 16% increase in its most recent payout in January, and its dividend has doubled since late 2014. Visa made an 18% boost to its dividend last November, completing a double over the past three and a half years.

Yet both MasterCard and Visa have highlighted share repurchases over dividends. MasterCard spent $3.5 billion on buybacks in 2016, more than four times what it paid in quarterly dividend payouts. Visa has gone even further, buying back more than $7 billion in stock over the same time. When you incorporate stock buyback activity, Visa is friendlier to shareholders in returning capital to investors.

Growth prospects and risks

Both Visa and MasterCard have pulled out all the stops in looking for growth opportunities, and they've largely been successful. Visa boasted a 25% boost in revenue in its most recent quarter, riding the wave of higher top-line results from its acquisition of Visa Europe last year. Even after accounting for the numbers that Visa Europe amplified, Visa did a good job of keeping international transaction revenue, transaction counts, and payment volumes moving higher. Some hints of potential issues from rising geopolitical tensions and uncertainty raised concerns among Visa investors, but the company has been pleased with the health of the global economy and prospects for a more complete recovery among some of the harder-hit regions of the world.

For MasterCard, the lack of a corresponding acquisition kept its numbers down by comparison to Visa, but it still has seen solid growth recently. In its most recent quarterly report, MasterCard reported revenue growth of nearly 10%, and a modest rise in net income translated to faster earnings-per-share growth due to the company's stock buyback activity. The payment processor reported good international results, including double-digit cross-border volume growth and transaction counts. MasterCard saw only small gains in its home U.S. market, and regulatory changes in Europe held the company back in some of its foreign markets. CEO Ajay Banga believes that further investment in data analytics and stronger security could help accelerate performance going forward.

Both Visa and MasterCard are attractive under current conditions, but Visa gets the nod here because of its slight edges in buyback activity and future outlook. If the global economy keeps moving forward, however, shareholders can expect both MasterCard and Visa to keep doing well in the future.

Before investing in stocks, here is some advice to help beginners choose the right ones.

Dan Caplinger has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Mastercard and Visa. The Motley Fool has a disclosure policy.