Some investors like to uncover value in stocks that have fallen off their highs, but sometimes it's worth following the wisdom of the crowd. Strong relative stock performance can be a positive signal for where a company is headed over the long term.

Sticking with the idea that winners tend to keep winning, here are two top tech stocks sitting close to new highs to consider buying for the long term.

A machine assembling a computer chip.

Image source: Getty Images.

1. Broadcom

Broadcom (AVGO 0.12%) is one of the leading semiconductor companies in the world, generating $60 billion in trailing revenue. The demand for artificial intelligence (AI) has caused accelerating revenue growth over the last few years, which has pushed the stock to rank among the most valuable companies in the world, with a market cap of $1.7 trillion at the time of writing.

The company's AI semiconductor revenue reached over $5 billion last quarter, or roughly a third of the business. This represented a 63% year-over-year increase. Investor enthusiasm for Broadcom's custom AI accelerators, in addition to networking products that help speed up the flow of data in data centers, has sent the stock up 54% year to date.

While AI remains a strong growth catalyst for Broadcom, investors shouldn't overlook the rest of the business. Broadcom has a very diversified product offering that it sells into several markets, including components for wireless communications, servers and storage systems, and factory automation, among others.

The company's non-AI business has reported weak results, but this also sets the stage for stronger growth when these markets recover. Non-AI chip revenue was flat last quarter, but management expects these products to experience a gradual U-shaped recovery, potentially starting to rebound by the middle of next year.

Even with Broadcom not completely firing on all cylinders right now, the business is still gushing profits thanks to strong demand for specialized AI chips and growth in its VMware cloud software business. When non-AI markets recover, the stock will have another growth catalyst to supercharge returns.

Overall, Broadcom has delivered annualized growth in revenue and earnings per share of 28% over the last decade. Analysts expect earnings to continue growing around this level over the next several years, which could support market-beating returns for investors.

A Google logo hanging from the jaws of a dinosaur skeleton.

Image source: Alphabet.

2. Alphabet 

Share prices of Google parent Alphabet (GOOG 0.29%) (GOOGL 0.23%) have surged to new highs recently, up 27% year to date. The stock now has a rich market cap of about $3 trillion, yet the shares still trade at a valuation that may undervalue its growth prospects.

AI is the heart of Alphabet's business. Specifically, its advantage is centered around Gemini -- Google's proprietary AI model. Gemini powers advanced search features like AI Overviews and other useful features, like searching information from your phone's camera using Google Lens. This positions Google as one of the few consumer brands that are generating revenue from AI. For example, AI Overviews is driving a 10% increase in global search queries, contributing to solid growth in search advertising.

AI also benefits the company's cloud computing business. Google's AI infrastructure, including data centers, custom chips, and Gemini models, are a major advantage. Google Cloud's infrastructure delivers optimal performance for AI workloads and gives the company a valuable edge in winning more business from enterprises and AI start-ups. The company reported a 28% year-over-year increase in cloud customers last quarter.

Strong demand for cloud services is starting to contribute to the company's overall profit. Google Cloud revenue grew 32% year over year last quarter, with operating profit more than doubling to $2.8 billion.

Alphabet's dominance in digital advertising and the profitable growth it's starting to generate from Google Cloud make the stock an excellent buy right now. Despite reporting strong growth in revenue and earnings, the stock trades at just 22 times next year's consensus earnings estimate. This is a conservative valuation for a leading AI company. Google stock should deliver long-term satisfactory returns for investors.