Not since the hype in 2021 have tech stocks been this hot. ChatGPT lit a fuse under anything tech-related and any company involved with artificial intelligence (AI). Microsoft (MSFT -2.45%), the company that invested billions into ChatGPT's owner, OpenAI, is no exception.

Year to date, Microsoft's shares are up around 40% and the Redmond, Washington-based tech giant is now at a $2.5 trillion valuation and right around its all-time highs. Has the stock become too expensive, or is Microsoft still a good buy right now?

Its earnings multiple is now up to 36

A price-to-earnings (P/E) multiple is a good way to gauge the value you're getting from a stock. You can compare it to similar stocks and even the stock's own history to see how relatively cheap or expensive it may be. Microsoft's stock is trading at 36 times its trailing profits, which is only slightly higher than the tech stock average of 33. But given how hot tech stocks have been of late, that may not be the best comparable right now.

Here's how its current P/E multiple compares to the past 10 years:

MSFT PE Ratio Chart

MSFT PE Ratio data by YCharts

There have been periods where the stock traded at higher valuations but for the most part, the stock's current multiple is a bit higher than where Microsoft's stock has traded in the past. 

Here's how it also compares to other big-name stocks that are involved with AI:

NVDA PE Ratio Chart

NVDA PE Ratio data by YCharts

When compared to Tesla and Nvidia, Microsoft's multiple does appear to be modest. However, those are also more volatile investments and so their valuations have fluctuated significantly, as the above chart suggests. Alphabet, which is a more direct competitor, with the two companies fighting head-to-head in search, trades at a notably lower earnings multiple of 28.

It appears clear that while Microsoft isn't grossly overvalued, investors do appear to be paying a premium for the business right now.

Investors shouldn't expect AI to lead to significant growth right away

AI should open more doors for Microsoft and there are ways that the company is already adding value for its customers. For example, Microsoft is adding AI features to its Office 365 suite and equipping its Bing search engine with AI capabilities as well.

I'm not convinced that will amount to much growth, however. Office 365 is already a staple in many offices around the world and with the main competition coming from Apple, it's likely going to take more than just a digital assistant that helps with day-to-day work tasks to entice customers to switch ecosystems.

The big question lies in search, where Google reigns supreme. If Microsoft can get a leg up thanks to superior search queries, that could be a game changer -- but it's far too early to tell if that will end up happening as Alphabet isn't standing pat -- it's working on developing its own AI as well.

But despite the emerging opportunities, Microsoft isn't getting ahead of itself as the company is forecasting revenue growth of around 7% for the current quarter (which ends in June).

Is Microsoft's stock worth its premium?

Microsoft's stock is expensive, but if you're planning to hold on to it for decades as a buy-and-forget type of investment, then it can still make for a great buy. The business has shown that it can continually find ways to expand and acquire other companies to fuel more growth. Plus, with around $60 billion in free cash flow over the trailing 12 months, it has plenty of resources at its disposal that it can deploy to help pursue growth opportunities.

It's in the short run where investors shouldn't set their expectations too high as the tech stock does appear overvalued in that sense. AI may enhance some of its products and services but there isn't a huge catalyst that will make the company's sales double in the next year or two.

Investors should temper their expectations for the stock because while Microsoft may generate great returns over the course of several years as its profits rise, it may end up giving back some gains this year as its valuation looks to have risen a bit too quickly in recent months.