The S&P 500 goes up more often than it goes down. Since its inception in 1957, the index has declined in 18 calendar years, but it has increased in 47 calendar years. It was also flat once. Another noteworthy statistic is that the S&P 500 tends to rebound following a down year. Since 1957, the index has produced a median return of 20% in the year immediately following a decline.

That information hints at possibly big gains in the not-too-distant future. The S&P 500 dropped 19.4% in 2022, and it has rebounded 7.4% in 2023. But if this year falls in line with the median, the index will rise another 12.6% before the end of 2023. Of course, past events never guarantee future results, but investors should view the current environment as a buying opportunity regardless of whether the stock market rises or falls in the near term.

Here are two growth stocks to buy now and hold forever.

Amazon: E-commerce, digital advertising, and cloud computing

Amazon (AMZN -1.14%) reported weak results last year when faced with economic headwinds, but those challenges are temporary and the company has already regained some momentum. Revenue increased 9% to $127 billion in the first quarter, and Amazon reported $4.8 billion in cash from operations, up from a loss of $2.8 billion the year before. Better yet, given Amazon's strong position in e-commerce, digital advertising, and cloud computing, sales growth and profitability should continue to improve as economic conditions improve.

The Amazon marketplace draws more monthly visitors than any other digital shopping destination. It accounted for 38% of online retail sales in North America and Western Europe last year. That success underpins a powerful network effect, meaning each buyer makes the marketplace more valuable to every seller, and vice versa.

But Amazon has reinforced that flywheel by offering merchants adjacent solutions for logistics and digital advertising, both of which make its marketplace even more compelling. Online retail sales are expected to increase 13.6% annually through 2030, and few companies are better positioned to benefit from that trend.

Amazon offers ad tech solutions that enable brands to run data-driven campaigns on and off the marketplace, and that segment of its business has been growing like wildfire. Amazon has quietly become the fourth-largest ad tech company in the world, and it's taking share from industry leader Alphabet. That portends strong growth in the future, as Grand View Research estimates the ad tech market will grow at a 13.7% annualized rate through 2030.

Finally, Amazon Web Services (AWS) dominates the market for cloud infrastructure and platform services (CIPS). It accounted for 32% of CIPS spending in the fourth quarter, putting it nine percentage points ahead of runner-up Microsoft. Moreover, consultancy Gartner says AWS offers the "greatest breadth and depth of capabilities of any provider in the market for CIPS." That hints at a greater capacity for innovation, which should keep Amazon at the forefront of cloud computing technology. Grand View Research estimates the cloud computing market will increase at 14.1% annually through 2030.

Currently, shares trade at 2.2 times sales, a bargain compared to the five-year average of 3.6 times sales, and a very reasonable price for a company with a good shot at double-digit revenue growth through the end of the decade.

PayPal: Digital payments

PayPal Holdings (PYPL -1.83%) reported solid financial results in the first quarter, a pleasant change of pace after a challenging 2022. Revenue increased 9% to $7 billion, and non-GAAP earnings rose 33% to $1.17 per diluted share. Both of those metrics represent sequential and year-over-year accelerations, and the particularly strong growth on the bottom line indicates that cost-cutting efforts are taking effect. Specifically, management has refocused its investment strategy on areas where the company enjoys a strong competitive edge: checkout solutions and digital wallets.

Indeed, the investment thesis centers around those products. PayPal operates one of the largest payment networks in the world, with 433 million active accounts. Few companies ever achieve adoption on that scale, and PayPal owes much of its success to its two-sided payments network. Most payment processors work only with merchants, but PayPal provides financial services to merchants and consumers, and that gives it an edge.

Specifically, PayPal has more insight into consumer spending habits compared to many peers. It uses that data to drive sales and prevent fraud for its merchants, and it does those things quite well. In fact, CEO Dan Schulman says PayPal has the lowest loss rates and the highest approval rate in the industry. In turn, PayPal has become the most accepted digital wallet in North America and Europe, and the market leader in online payment processing software, according to Statista.

Here's the bottom line: PayPal is well-positioned to benefit as digital payments become more prevalent. But the company isn't simply resting on its laurels. PayPal has continued to develop new products in an effort to reinforce its strong market presence. It recently launched PayPal Complete Payments (PPCP), an unbranded checkout solution that complements its Braintree platform. Braintree is designed for large enterprises, but PPCP is built for small businesses, and management believes the product extends its addressable market by $750 billion.

PayPal stock currently trades at 2.5 times sales, its cheapest valuation in more than five years. That creates a very attractive buying opportunity for patient investors.