Recent conditions have been brutal for the stock market, but there's some good news if you've otherwise got your financial bases covered and are looking to turn $10,000 into $50,000. Big valuation pullbacks have created worthwhile opportunities to invest in some promising companies, and time is on your side. 

With that in mind, read on for a look at two stocks that could have what it takes to deliver 5x returns before the decade is out. 

Hundred-dollar bills.

Image source: Getty Images.

1. Cloudflare

Cloudflare (NET 1.44%) is a leading provider of web technologies, including content-delivery-network (CDN) and domain-name-system (DNS) services and protection against distributed denial-of-service (DDoS) attacks. The company's stock trades down approximately 73% from its previous high, but I expect that it will eventually bounce back and go on to deliver strong returns for long-term investors.

Despite some mounting headwinds as the year progressed, Cloudflare delivered another period of strong performance with its fourth-quarter results. Even with macroeconomic conditions tamping down on demand somewhat, Cloudflare continued to see existing customers increase their spending on its services. The web software company recorded a net revenue retention rate of 122% in the period, which means that clients increased their spending by 22% year over year on average.

Along with new customer additions, strong net revenue retention helped push Q4 revenue up 42% year over year to $274.7 million and annual revenue up 49% to $975.2 million, and bring the company's annualized revenue run rate to roughly $1.1 billion. With its recent fourth-quarter earnings call, management reiterated that the company is on track to reach an annualized run rate of $5 billion by the end of 2027. Even better, Cloudflare expects to be able to achieve this feat organically, and it's possible that mergers and acquisitions could wind up with the company actually achieving an annualized revenue figure that's significantly above its current target for the year. 

NET PS Ratio (Forward) Chart

NET PS Ratio (Forward) data by YCharts.

With a market cap of roughly 18.9 billion, Cloudflare is valued at approximately 14.2 times expected sales. The company appears to be on track to more than quintuple its sales before the next decade begins, which strengthens the case for the stock potentially delivering 5x returns across the stretch, but improving profitability and remaining long-term growth potential at the end of the period are also key factors. 

Cloudflare closed out last year with a non-GAAP (adjusted) gross profit margin of 77%. While this was down from the 79% adjusted gross margin it posted in the prior-year period, it's still a fantastically high margin that bodes well for the company's long-term earnings growth potential. The business is largely focused on scaling right now, but it should have opportunities to continue reducing marketing and other expenses as a percentage of overall revenue down the line and tap into favorable long-term demand catalysts for its core batch of web services. 

2. PubMatic

PubMatic (PUBM 1.75%) is a digital-advertising technologies company that provides a platform for automating and driving efficiency for ad publishing. Facing a slowdown in some key areas of the economy, the digital ads market has been going through a rough stretch -- and the worst of it might not be over. With uncertainty on the horizon, investors have dumped stocks with heavy exposure to the ads market, and PubMatic has participated in the pullback. The company's share price has fallen roughly 81% from its peak.

While the macro picture is unfavorable and will likely continue to pressure the company, PubMatic has actually shown some encouraging resilience thus far. The business faced mounting pressures as last year progressed, but it still managed to increase revenue by 13% annually to reach $256.5 million in 2022. That's a big deceleration from the 53% sales growth it posted in 2021, and net income also dropped by half to $28.7 million, but the business remained profitable and continued to grow sales. 

With the company valued at roughly $708 million and sitting on a net cash and equivalents position of $174.4 million at the end of last year, PubMatic sits squarely in small-cap territory and looks cheaply valued for long-term investors at current prices. Shares trade at roughly 37.5 times this year's expected earnings and 2.5 times expected sales.

PUBM PS Ratio (Forward) Chart.

PUBM PS Ratio (Forward) data by YCharts.

When macroeconomic conditions improve or the next bull phase for growth-oriented stocks rolls around, PubMatic stock stands a good chance of seeing a serious, positive reappraisal. The company's forward price-to-earnings ratio has been pushed up on expectations that macro conditions will lead to weaker earnings this year, but there's a good chance the backdrop for the ads market will improve over the next five years. PubMatic stock could also quintuple from its current price and still be down roughly 5.5% from the high that it reached in March 2021.

Between a core business that actually looks pretty solid despite big sell-offs for the stock and a small-cap valuation that leaves room for potentially explosive upside, I think PubMatic is a good candidate to deliver 5x (or greater) returns before this decade draws to a close.