Investors may want to be careful when buying tech stocks, as some names in the sector have become overvalued after their recent gains. The Technology Select Sector SPDR Fund (XLK) and tech-heavy Nasdaq Composite have both risen around 18% this year with the XLK surging nearly 10% in the past month alone. The S & P 500 has jumped to record highs this year along with the Nasdaq, up 14%. What’s more, the CNBC Magnificent 7 Index has seen gains nearly twice that of the XLK and Nasdaq year to date, rising about 35%. These strong gains in tech, however, have led to exceedingly high valuations for some companies in the space. CNBC Pro screened FactSet data for stocks in the XLK whose forward price-to-earnings ratio is above the S & P 500’s. We then filtered for names trading above their respective five-year average forward P/E and are beating the broad market index with year-to-date gains of at least 14%. Take a look at the list of companies below: Super Micro Computer has become one of the biggest recipients of the artificial intelligence craze on Wall Street and may be overvalued. The stock trades at a forward P/E of 23.4, which is nearly double its five-year average P/E of 12.6. Barclays has remained bullish on the stock, giving it an overweight rating. In a note on June 6, the firm said it expects Super Micro to grow its AI server market share to nearly 25%. While shares have been down more than 23% quarter to date, the stock is up more than 170% in 2024. Broadcom also made the list. The stock is trading at a forward P/E, 59% higher than its five-year average multiple. Analysts are bullish on the stock, with nearly 63% giving it a buy rating. The chipmaker rose 13% after the company topped earnings estimates for the second fiscal quarter and announced a 10-for-1 stock split that’ll take effect on July 15. Many analysts reacted positively to the results and stock split. Barclays, JPMorgan, Citi and UBS all raised their price targets on the stock. Microsoft, another AI winner, may also be overvalued. The megacap tech stock’s forward P/E of 32.8 is 13.1% above its five-year average. That said, the stock has the highest percentage of buy ratings in the group at 81%. Jefferies named Microsoft a top AI pick in a Thursday note, maintaining a buy rating with a price target of $550, which implies about 25% upside. On Friday, Oppenheimer boosted Microsoft’s price target to $500 from $450 due to the increasing adoption of its AI-related tools.