The U.S. has been in recession since February, and how long it will last is uncertain, likely depending on when a COVID-19 vaccine or treatment is ready for the public. Predictions range from an end this year to a double-dip scenario that stretches into 2021. While the stock market has surged back from its March lows to regain its losses, some sectors have become overvalued, and we have seen some of this snap back in the technology sector.

A diversified investment portfolio should include a mix of stocks with long-term growth that perform well in varying economic and market conditions. This provides you with protection during recessionary periods so your portfolio's performance doesn't fluctuate wildly with the markets.

As the economy may continue to sputter for the next six to 12 months or beyond, now is a good time to put some all-weather tires on your ride. Here are a couple of recession-ready stocks that will plow through the recession with strong returns.

A close up of a $100 bill with Ben Franklin wearing a COVID-19 mask.

Image source: Getty Images.

Dollar General is leading the charge

Discount retail chain Dollar General (DG 0.30%) is a model of consistency. Fiscal 2019, which ended Jan. 31, was the 30th straight year that the company saw an increase in same-store sales (total revenue in stores that have been operating for more than a year), which has translated into remarkably consistent stock price performance. Over the past 10 years, it has not had one year of negative returns, averaging an annualized return of 21% over that period.

This year has been another good one for Dollar General, recession or not. In fact, it has been better than average. In the second quarter, same-store sales were up 18.8% in the second quarter, year over year, while net sales increased 24%, operating profit jumped 80% to $1 billion, and earnings per share climbed 89% to $3.12 per share. Also, cash flow from operations surged 157% to $2.9 billion, meaning the company is well capitalized to make continued investments and expand with new initiatives like DG Pickup, DG Fresh, and its Non-Consumables Initiative, which includes expansion of its home products and housewares.

This is all reflected in a stock price that is up about 30% year to date at Wednesday's prices, higher than its long-term average. The value that Dollar General provides with its discount prices in small-town and neighborhood locations is relied upon even more during tough times. "It has never been more evident just how essential our role is as our customers depend on us now more than ever for their everyday household needs. We remain committed to being part of the solution during these difficult times, and believe we are uniquely positioned to continue supporting our customers through our expansive network of nearly 17,000 [stores] within five miles or more than 75% of the U.S. population," CEO Todd Vasos said on the second-quarter earnings call.

Dollar General should continue to outperform, with 50% earnings growth expected this year and consistent growth over the next five years, according to analysts' projections. You can count on this steady performance to anchor your portfolio through the uncertainty.

PayPal is an investor's best friend

PayPal Holdings (PYPL 0.64%) will be there for you, the investor, through thick and thin, like any good pal. That's because as world economies have gradually moved away from cash and toward digital payments and e-commerce, the online payments pioneer has become recession-proof.

Since it returned to the public markets in 2015, PayPal has had double-digit annual earnings growth -- and the stock has gone into high gear this year, up about 70% at Wednesday's prices. The company saw earnings climb 85% year over year in the second quarter to $1.5 billion. Revenue increased 22% to a record $5.3 billion as payment volumes on its platform rose 29% to $222 billion. As you know, if you have ever used PayPal, the company makes money on fees every time you send or get money. PayPal's Venmo service has driven the revenue gains with $37 billion in total payment volume in the quarter, up 52%.

Cash flow from operations grew 103% to $2.4 billion and free cash flow jumped 112% to $2.2 billion. The company has a robust 18.1% operating margin that is up 170 basis points (that is, 1.7 percentage points) year over year, which means it has relatively low debt and lots of money to invest.

As the online payments leader in a world that is moving away from cash, PayPal is only going to grow in popularity, making it recession-proof. A recent study by Mastercard outlined how economies are accelerating the move toward mobile and online payments, with some entirely cashless in 10 years. 

PayPal has 346 million active accounts, up 40% year over year, with 26 million merchant accounts. Those numbers are only going to continue to climb, especially now that more people are working from home and practicing social distancing.