The best stocks can change your life.

Companies that compound your wealth year after year for long periods of time can help you build a fortune. Walmart (WMT -1.48%) has done that and more for many of its shareholders.

The discount retailer opened its first store Rogers, Arkansas in 1962. Nearly six decades later, Walmart operates more than 11,000 stores around the world that together employ 2.2 million people and generate more than $500 billion in annual sales. 

A person pointing to an upwardly sloping chart

Walmart has grown from a single location into a massive global retail empire, creating tremendous wealth for its shareholders along the way. Image source: Getty Images.

Walmart had its initial public offering (IPO) on Oct. 1, 1970. The stock was first sold to the public at a price of $16.50 per share. Since that day, Walmart has split its stock 11 times. Each split was 2-for-1, meaning that investors received an additional share for each share they owned (though the share price was reduced to half the value of the stock's original price). Thus, with each split effectively doubling the number of shares you own, if you had purchased one share of Walmart's stock on the day of its IPO and held until now, you would have 2,048 shares today.

If instead, you had purchased $5,000 worth of stock, you would have purchased 303 shares at the time of Walmart's IPO. After 11 splits, you would own 620,544 shares. And at the stock's current price of $120 per share, those shares would be worth more than $74 million.

These are absolutely staggering returns. And they would have created immense wealth for anyone who was fortunate enough to buy some shares of Walmart way back in 1970 and hold them all the way to today.

Yet, incredibly, these returns don't even include the impact of dividends.

Walmart began paying a cash dividend in 1974. It's increased its payout for 46 consecutive years since then. These cash payments have provided investors with a bountiful and steadily rising income stream along the way.

At Walmart's current dividend rate of $0.53 per share, 620,544 shares pay out just under $329,000 per quarter and more than $1.3 million per year. That's a decent amount of money to live on and a pretty solid return on an initial $5,000 investment for anyone fortunate enough to have made it.