If you're sitting on some extra cash, there's not a better time to consider putting that money to work in the stock market. Leading tech companies like Alphabet (GOOG 9.96%) (GOOGL 10.22%) and Amazon (AMZN 3.43%) have reported improving growth over the last year, but these companies have great prospects in 2024 and beyond.

An investor with less than $1,000 could buy at least one share of each stock right now. Here's why these two companies are no-brainer investments.

1. Alphabet 

Over the last 10 years, shares of Alphabet knocked it out of the park for investors, as the company rode strong tailwinds in the digital advertising market. The stock has returned 147% over the last five years and is sitting close to new highs as the online advertising market recovers from the macroeconomic headwinds, but the market still underestimates Google's advantages in data and artificial intelligence (AI).

The stock offers an attractive valuation to get started with a new investment. It trades at a forward price-to-earnings ratio of 21. This ratio suggests the stock is quite affordable, especially given the company's recent earnings growth (it was up 27% in 2023 and is expected to rise another 17% in 2024).

Alphabet should maintain strong growth. It has an advantage with lots of data from billions of users that rely on Google products. This will enable the company to make its Gemini AI model smarter and create sophisticated tools for content creators on YouTube, and importantly, advertisers.

AI will also drive demand for Google Cloud, which is starting to turn a profit after years of losses. The cloud business is turning the corner financially while seeing demand for generative AI services. Top brands recently expanded their relationship with Google Cloud, including McDonald's and Verizon Communications.

For these reasons, the stock is a no-brainer buy in 2024.

2. Amazon

Amazon stock has been an outstanding performer for investors. Strong growth in the company's online retail and cloud businesses sent the stock soaring over the last decade, and it's currently up 101% in just the last five years. Following the stock's steep decline in 2022, it is on the rebound and could have significant upside as growth across the business starts to pick up again.

What's most impressive about Amazon's performance right now is that management is squeezing more profit out of the business while still doing the same things that built the brand over the last two decades. It's adding more value for customers with same-day delivery and keeping retail prices competitive while posting a whopping 383% year-over-year increase in operating profit in 2023's fourth quarter.

In fact, Amazon generated record operating profit of $36.8 billion last year, and management previously mentioned it's still finding ways to squeeze more efficiency out of the retail business.

Amazon still has several areas outside of retail to deliver returns to shareholders. Online and physical stores made up only 43% of Amazon's total revenue last year. The rest came from growing revenue streams in high-margin businesses like advertising, subscriptions, third-party seller services, and the Amazon Web Services cloud business.

Amazon could grow its profits substantially over the next decade. It still has a significant runway for growth in global e-commerce and cloud services. These opportunities can allow Amazon to reach $100 billion in operating profit within the next 10 years. That would push the stock's value higher, making the shares a no-brainer investment.