Sometimes, it's hard to convince yourself to buy a stock that's declining. It's much easier to imagine yourself jumping on board a stock that's already in great demand because gains may seem like a sure thing.

But many times, it's a better idea to buy a quality company when it's down. You'll get the stock at a good price and likely benefit from that purchase over time.

Certain growth stocks offer you that opportunity right now. Two top examples are e-commerce players Chewy (CHWY -0.73%) and Etsy (ETSY -3.06%). Both stocks have fallen in the double digits so far this year, despite bright long-term outlooks. Let's take a closer look at these two growth stocks you'll wish you'd bought on the dip.

1. Chewy

Chewy isn't your ordinary pet shop. Sure, it offers food, toys, and other supplies. But the online retailer also has invested in delivering healthcare services such as online vet visits and pet insurance. Chewy has seen a pause in active customer growth, due to the general economic environment. Rising inflation has hurt shoppers' wallets.

But overall, things are looking positive. In the most recent earnings report, Chewy announced record revenue, profit, and free cash flow. Net sales in the quarter and fiscal full year rose in the double digits. Gross margin for both periods expanded to about 28%, due to pricing strength and a more efficient supply chain.

Speaking of supply chain, the company has been revamping it to include features such as automation. Chewy plans on opening a fourth automated fulfillment center in the first half of the year. These efforts should help Chewy maximize margins over the long term.

It's also important to look at what Chewy's accomplished over time. The company has increased revenue to more than $10 billion from about $3.5 billion in just four years. During that period, it also improved adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA) margins to 3% from negative 6.5%.

The total U.S. pet market is worth about $130 billion -- and that leaves Chewy plenty of room for growth. Today, the company's shares trade for 64 times forward earnings estimates -- down from more than 120 earlier this year. That's very reasonable for the high growth we've seen at Chewy and the potential for more down the road.

2. Etsy

Etsy brings together sellers of handmade goods and potential buyers. In fact, the company's connection with shoppers is one of its strengths. Even in a difficult economic environment, the e-commerce company still is managing to add active buyers and reactivate old ones.

In the first quarter, the company increased active buyers 1%, to nearly 90 million. This was the first time this metric gained since the fourth quarter of 2021. And reactivated buyers grew by 21%.

As with Chewy, it's also key to look at trends over time. Etsy has increased active buyers and reactivated ones in the triple digits from four years ago. The e-commerce company also is profitable and holds more than $1 billion in cash and equivalents.

Why do people keep flocking to Etsy? The quality and variety of unique items is one reason -- and at price points to suit every budget. Etsy also continually works on improving search functions for shoppers and the platform for sellers. For instance, Etsy has boosted search personalization, and this has lifted order value.

Another strength is Etsy's capital-light structure. The company doesn't have to invest in warehouses to store goods or transport systems to deliver them -- since its sellers take care of stocking and shipping their products. All of this means Etsy can turn most of its adjusted EBITDA into free cash flow.

Right now, Etsy shares trade for 23 times forward earnings estimates, down from more than 30 earlier this year. This looks like a bargain, due to the points above. Considering Etsy's growth prospects, the stock may not stay this cheap for long.