Very few people predicted a global pandemic that would take a toll on people's health, and the economic pain that it would cause. That's why many individuals happily turned the page on 2020 and are looking forward to a better 2021.

However, amid these challenges, both Costco (COST -0.50%) and Clorox (CLX 0.04%) produced revenue and profit gains, and shareholders had very nice years. Costco's stock price appreciated by 28%, while Clorox's shares did even better, rising by 32%. These trounced the S&P 500's 16% gain.

But the question is, which one is set up to provide sustainable success that benefits shareholders over the long run?

A man looking at papers and a tablet.

Image source: Getty Images.

Costco's simple formula

Costco's warehouses sell a wide array of goods and services -- many in bulk -- at low unit prices. This is everything imaginable, including basic items like paper towels and toilet paper, food, and major appliances. These are high quality, and Costco is well-known for its generous return policy that gives members greater confidence in making purchases.

The pandemic helped fiscal 2020 (ended Aug. 30, 2020) revenue, but its loyal and increasing memberships have been driving results for years. Renewal rates have been strong, including 91% in the U.S. and Canada last year, and paid memberships grew from 47.6 million in 2015 to 58.1 million last year.

They are spending money, too. Costco's same-store sales have been positive for many years, including an 8% increase last year when excluding foreign currency translations and gasoline price changes.

It is off to a good start this year, and there's no doubt that Costco, with its strong offerings and low prices that attract members, is poised to continue growing sales and profitability for some time.

While many companies have a higher than 0.7% dividend yield, the board of directors has raised the payments annually for some time. Additionally, Costco also pays large, special dividends periodically, including a $10 payout last month.

Can Clorox replicate this year's success?

COVID-19 caused people to rush out to buy Clorox's products, including its namesake disinfectants. It also owns other well-recognized brands such as Pine-Sol, Liquid-Plumr, Fresh Step, Glad, and Brita. Cleaning products, at over 40% of annual sales, is the company's largest category, followed by bags (15%), food products (10%), and grilling products (8%).

Typically, while Clorox is either the top or second-largest seller for many of its offerings, these are slow-growth areas. Last year, which ended on June 30, was an exception. With more people staying home, its adjusted sales rose by 10%. Over the previous four years, its compounded annual growth rate was only 2%, however.

This year, with pandemic cases surging, and people's movements still restricted, robust sales growth continued, increasing by 27% in the first quarter. With vaccines getting distributed, hopefully a return to normalcy is in sight. That also likely means that Clorox's top-line increases will slow down, though.

The company is a strong dividend payer, and if you're looking for reliable income, this fits the bill. The yield is 2.2%, and after raising the dividend by 5% last August to $1.11 per quarter, Clorox's streak is now 51 consecutive years.

However, Costco's growth prospects remain bright as it attracts and retains members who spend money on its goods and services. Meanwhile, it provides higher dividend payments and has a history of paying large, special dividends every few years. The combination of growth and income makes Costco's stock the better long-term stock investment.