Investors can't go wrong putting their money in strong consumer brands. Despite 40-year-high inflation, PepsiCo (PEP -0.41%) and Visa (V 0.05%) have reported solid growth, which is reflected in their stock performance. 

At the time of writing, PepsiCo shares are down less than 1% year-to-date, while Visa shares have fallen 7%. Both stocks have outperformed the 16% drop for the S&P 500 index over the same timeframe. It's a good reminder that you don't have to chase high-growth, risky stocks to beat the market.

While no business is completely recession-proof, PepsiCo and Visa are relatively safe investments with decent long-term growth prospects. Let's review the most important reasons to hold these stocks for the long haul.

1. PepsiCo

Investing in brand power is arguably the best way to protect and grow your money over the long term. Companies with brand strength can raise prices over time to keep up with rising inflation over many decades without losing sales volume.  

PepsiCo owns many of the top brands you'll find on the shelves at convenience and grocery stores. In addition to its namesake beverage, PepsiCo owns Mountain Dew, Quaker Oats, Gatorade, Cheetos, Lays, among other road trip delicacies.

Coming off a strong finish to 2021, PepsiCo has continued its momentum. Organic (adjusted) revenue grew 13% year over year in the first half of 2022, with adjusted earnings also up a solid 9%. Those are great numbers amid the challenges with inflation and supply chain issues over the last few years. PepsiCo certainly has a world-class operation built over decades, and management continues to squeeze more efficiency out of the business.

PepsiCo recently announced a long-term distribution agreement with leading energy drink maker Celsius, which gives the snack food giant an 8.5% stake in the business in exchange for a cash investment of $550 million. The transaction will firm up PepsiCo's competitive stance against its rival Coca-Cola, which has a partnership with Monster Beverage. 

You're not going to get rich overnight with this stock, but PepsiCo is a relatively safe way to grow your money for retirement. Shares trade at a premium valuation, so they're not cheap. But the company's brands have led to consistent profits and dividend payments. Indeed, PepsiCo is a true Dividend Aristocrat, currently paying out an above-average dividend yield of 2.52%.

2. Visa

There is a lot of action in the digital payments landscape these days. Cryptocurrency, mobile wallets, and peer-to-peer payments give consumers many new ways to make transactions, but the major card brands are still going strong with a long runway of growth.

Visa and Mastercard are the two largest payment networks. Both are great long-term investments to consider, but Visa offers similar growth prospects while trading at a lower valuation than its chief competitor. 

After a slowdown in payment volumes during the start of the pandemic, Visa has reported terrific growth over the last year, with revenue growing at double-digit rates for five consecutive quarters. Management credited a pick-up in travel spending for driving strong growth in the second quarter. As international travel and cross-border transactions continue to recover, Visa should maintain its momentum.

With only a few card brands controlling the market, Visa is able to earn an above-average profit margin of 52%. Visa cards are accepted at over 80 million merchants worldwide, which gives it a solid competitive advantage against alternative payment methods. Investors shouldn't expect consumers to ditch their credit cards for cryptocurrency anytime soon.

The stock is up over 500% over the last 10 years, and it could repeat that performance. The stock is priced at 27 times expected earnings, which is consistent with its history and certainly worth it, given Visa's record of growth and dominant position in the marketplace. 

Moreover, there were still $18 trillion in annual spending using cash and checks as of 2018. That represents an enormous opportunity for Visa to convert more of those expenditures to digital payments over time.