Last week was a great one for the S&P 500, with the index scoring its best weekly performance of the year. And two stocks participating in these gains are ones that could drive the index higher in the near term and over time. These companies have shown their strength in the past, with earnings and share price soaring. In fact, both players actually completed stock splits last year to bring their share prices back down to earth -- and make them more accessible to a broader range of investors.

In a stock split, a company issues additional shares to current investors to lower the individual price -- but this doesn't change the total market value of the company. Stock splits often are a sign a company has done well in the past and is confident in its ability to drive more share gains moving forward.

So, which stock-split companies are helping the S&P 500 rally? None other than Amazon (AMZN 0.81%), an e-commerce and cloud computing giant, and Alphabet (GOOG 0.32%) (GOOGL 0.37%), parent company of search powerhouse Google. Let's take a closer look at these stock-split players to buy now.

A woman holds a credit card up as she shops on her tablet.

Image source: Getty Images.

1. Amazon

Amazon is a leader in the two high-growth markets of e-commerce and cloud computing. The company has a long track record of earnings strength and has taken steps recently to supercharge growth moving forward.

In e-commerce, Amazon already promises free same-day or one-day delivery to Prime customers as well as several other convenient delivery options. But the company aims to get even faster. It's doing this by shifting its delivery model to a regional one from a national one, stocking popular items in eight different centers across the country. Shorter delivery distances save Amazon time and money -- and the quicker deliveries spur customers to keep coming back.

As for cloud computing, Amazon's investment in artificial intelligence (AI) could help this already significant business flourish in the coming years. AWS has launched services that help companies apply AI to their businesses without having to start from scratch or maintain complicated infrastructure. For example, Amazon Bedrock offers clients foundation models they can customize for their own use.

Finally, Amazon's move last year to improve its cost structure has helped it better manage today's tough economic environment. The company cut jobs and shifted investments to favor high growth areas like technology infrastructure. All of this also should help Amazon earnings and shares to truly take off once the economy strengthens.

So, there are plenty of reasons to believe this stock-split player can head significantly higher once again.

2. Alphabet

You may use Alphabet's services every day without even realizing it. Whenever you "Google" something, you're dealing with this top technology company. Alphabet generates most of its revenue from Google search advertising, but it also makes money through YouTube ads, cloud services, and selling hardware.

First let's focus on Google Search. It already holds more than a 91% share of the search market, but Alphabet continues work to make Google Search even better. The company is doing this by investing in generative AI, which could add more elements to search results such as images and video, and can offer answers to a wider range of questions.

Alphabet's work to incorporate generative AI also includes the area of advertising, with AI offering the ability to create very precise ads to connect with Google users. All of this should please advertising clients, and that bodes well for Google Search revenue down the road.

Alphabet's cloud is a smaller business than search, but it's continued to grow in the double digits even through a difficult economy. And like Amazon, Alphabet is going all in on AI in its cloud business too. The company's Vertex AI tool, which helps customers build AI applications, saw projects on the platform multiply by seven from the second quarter to the third quarter.

Even though AWS dominates the cloud market, there's still room for Google Cloud to continue growing and generate significant revenue. This, paired with Alphabet's search strength and earnings track record, makes me optimistic about Alphabet's future performance. And that's why, as the S&P 500 rallies, I wouldn't hesitate to buy this stock-split company -- the shares, once again, could soar over time.