Turning a $1,000 investment into $10,000 sounds like a feat, but over time, many stocks have achieved this. It's more incredible when it happens quickly, but slow and steady typically wins the investing race. Turning $1,000 into $10,000 means letting it grow 1,000%. And often it's nothing more than that -- simply letting it grow, not getting worried about the upticks and downticks, and not panic-selling. Buy shares in great companies, and let the magic of compounding do its work.

Home Depot (HD 0.74%) and Costco Wholesale (COST -0.24%) are two stocks that have slowly and securely grown and turned $1,000 into more than $10,000.

Home Depot: 12 years, 1,200%

Home Depot is the largest home improvement chain in the world, with $132 billion in 2020 sales. It operates 2,317 stores, the vast majority of which are in the U.S., although it also has stores in Canada and Mexico.

A Home Depot worker putting products on a shelf.

Image source: Home Depot.

2020 was an especially fruitful year for the company, as shoppers staying home spent their money on home improvement, and Home Depot's strong digital program made it easy to shop online. It was also considered an essential store that was allowed to stay open during lockdowns, and 2020 sales increased 20% year over year. Sales growth has decelerated since then, as expected, but it's still strong -- in the 2021 third quarter, sales increased 10% year over year.

Demand remains strong, and the company has been able to meet it despite supply chain disruptions. Management is looking toward the future, upgrading its systems to handle omnichannel shopping. 55% of online orders in the third quarter were fulfilled in stores, and Home Depot is testing productivity enhancements, such as store-specific assortments, to provide a better shopping experience for customers. Investors can expect many years of growth from Home Depot.

I want to point out that not every year is a good year for the stock. At first glance, this looks like a fairly straightforward chart of gains, outside of the 2020 crash. But notice that there are several dips along the way, and Home Depot stock lost 10% of its value in 2018.

Chart showing rise in Home Depot's price since 2018, with recent fall in 2022.

HD data by YCharts

The company went through some growing pains at that point, after it invested in a new digital strategy, which took longer than anticipated and pressured profitability. It's also down 12% year to date in 2022. But you already know to look past that, and see this as an opportunity. Shares are trading at only 24 times trailing-12-month (TTM) earnings at this price, making it an excellent time to take a position in this top stock.

Costco: 18 years, 1,200%

Costco is another stock that doesn't make a lot of waves but racks up gains over time. The warehouse giant is still posting high year-over-year increases, even though the pandemic-induced essentials stock-up has passed. In the fiscal first quarter (ended Nov. 21), sales increased 17% year over year. That's because customers seeking low prices as inflation sends prices higher flock to Costco's discount stores. That's also why Costco is a winner in any economy, although it often shows its best colors during economic volatility.

Person loading groceries into car.

Image source: Getty Images.

Costco only owns 828 warehouses worldwide, with 572 in the U.S. It opens stores at a fairly slow rate, with plans for about 30 net new stores in fiscal 2022, after 20 net new units in 2021. Comps are a big part of Costco's success, but its low store count gives it plenty of room to keep growing over time. It's also embraced e-commerce, which exploded during the pandemic, and remained elevated after lockdowns. E-commerce sales increased 14% year over year in the first quarter, and accounted for 8% to 9% of total sales.

Costco stock has lost about 14% of its value in 2022, alongside other stocks feeling the market correction. Even at the lower price, it's not incredibly cheap, trading at 42 times TTM earnings. Investors pay this premium for Costco's growth and reliability.

Both Home Depot and Costco have gained much more than 1,000% over their lifetimes. The earlier you start investing, the more you stand to gain, and the easier it is to ensure a large and secure portfolio for retirement, or for whenever you need it.