With the Nasdaq Composite up 32% so far in 2023, many growth stocks are trading at more expensive valuations than a year ago. But there are still good deals to be found.

Shares of Google parent Alphabet (GOOG 9.96%) (GOOGL 10.22%) are up 48% year to date, but the company's opportunities to serve up more useful features and services powered by artificial intelligence could kick off a bullish run for the stock over the next several years.

Likewise, Spotify Technology (SPOT 0.20%) is experiencing strong momentum this year, but the stock is still selling at a discounted valuation despite rebounding 77% this year. Here's more detail on why these top stocks are good investments for the long term.

Alphabet

Artificial intelligence (AI) has taken the world by storm this year. Consumers have gotten their first taste of how smart this technology can be, as several text-based applications powered by generative AI launched in recent months. If you're looking for ways to get more exposure to this megatrend, Alphabet has been investing in AI for years and could be primed for strong growth in the next bull market.

The stock took a hit last year as advertisers pulled back on spending amid the uncertain economic environment. Advertising is how Alphabet makes most of its money, so investors got a healthy reminder last year that even dominant Google is vulnerable to a soft economy. Over the last two quarters, Alphabet's revenue has slowed dramatically from double-digit percentages in 2022 to single-digit rates in 2023. But as companies become more interested in investing in AI tools to help grow their businesses over the long term, Google is already proving to be a valuable partner.

In the second quarter, revenue accelerated to 7% year over year, up from 3% in the first quarter. The improvement in growth was driven by higher revenue in Google Search and YouTube ads. Google is in the process of bringing generative AI features to Search that could generate even better growth. The business strategy behind this is that users will spend more time searching as they receive smarter answers to queries. Many people search while shopping, which opens a perfect opportunity to deliver more relevant ads to users.

Another growth catalyst for Alphabet is cloud services, which also benefit from AI demand on the enterprise side. Investors have been concerned about slowing growth across the cloud infrastructure market, but Google Cloud reported a 28% year-over-year increase in revenue in the second quarter, which is stable with the first quarter and better than the cloud market overall. Google is gaining market share, and what's more, the cloud segment is finally turning a consistent profit after years of losses.

With the broader advertising market starting to stabilize, and Google Cloud starting to contribute to the company's profits, this top tech stock seems undervalued. It trades at a forward price-to-earnings (P/E) ratio of 24, lower than the S&P 500 P/E of 26. The stock is a great buy right now considering how deeply embedded AI technology is across Alphabet's business.

Spotify Technology

Spotify is the leading audio platform, with 551 million monthly active users. Some investors might believe it doesn't have much room to grow from here. After all, Netflix ran into some growth problems last year with over 200 million subscribers. But the market for music and podcasts is a different league than video.

Unlike audio, video is time-consuming. A movie demands your attention, but audio is a passive activity. You can listen while commuting to work or doing a workout. This is one reason Spotify has over twice as many users as Netflix, and is still growing strong.

Spotify's user base grew 27% year over year, translating to an 11% increase in revenue in the second quarter. Users are growing faster than revenue because Spotify is seeing robust growth for its free ad-supported service.

Premium subscribers are also growing strong, up 17% year over year. The biggest driver of subscriber growth are users who start out with the ad-supported service. Management attributes this growth to recent investments in new content and features, such as AI DJ, which smartly curates a dynamic playlist to each user's taste. It seems the company still has a lot of improvements it can bring to the platform with AI that could drive more demand for premium subscriptions.

Spotify has spent the last few years making major investments in bringing more podcasts to the platform and rolling out advanced features, which is starting to pay off. With demand for the service increasing, Spotify's recent price increase for premium plans is coming at the right time, and is a catalyst for strong revenue growth entering 2024. 

Another catalyst is management's renewed focus on lowering costs. As part of this effort, it recently reduced some of its podcast investments. The adjusted operating profit margin improved to negative 3.5% in the second quarter, a significant reduction from negative 6.1% in the year-ago quarter. With such strong growth in new sign-ups right now, it wouldn't be surprising to see Spotify turn a profit soon.

Strong demand, lower subscriber churn, and improving profitability have Spotify trending in the right direction, but the stock's current price-to-sales (P/S) ratio of 2.1 is a big discount to its five-year average P/S multiple of 3.8. The stock appears to be a bargain, despite nearly doubling in value this year. It could have more room to run over the next few years and beyond.