The tech industry has gained a reputation for being one of the best places to find reliable long-term investments. Many of the world's biggest tech companies, such as Apple (AAPL -0.35%), Microsoft, Amazon, Nvidia (NVDA 6.18%), and others trade on the Nasdaq Stock Market rather than alternative U.S. exchanges.

The chart below shows how the Nasdaq Composite has risen significantly higher than the NYSE Composite over the last five years. The Nasdaq's growth is primarily owed to tech companies, which regularly see significant gains.

^IXIC Chart

Data by YCharts

Tech companies profit immensely from the innovative nature of the market, benefiting from consistent demand for upgraded devices and software. As a result, the tech sector can be a fruitful area to hunt for investments. Here are two such stocks well worth considering for your portfolio now.

1. Nvidia

As one of the biggest names in chips, Nvidia's stock is an excellent way to invest in and profit from growth in multiple areas of technology

The company supplies its hardware to businesses across the industry, powering everything from laptops to cloud platforms, custom-built PCs, video game consoles, and more. Demand for chips is rising quickly as more companies require graphics processing units (GPUs) like Nvidia's to take their tech to the next level. As a result, Nvidia's stock has skyrocketed 840% over the last five years, alongside soaring demand for chips.

Nvidia has become a favorite on Wall Street this year with its massive potential in artificial intelligence (AI). The AI market hit a value of $137 billion last year, and is projected to expand at a compound annual rate of 37% through 2030. Meanwhile, the company has snapped up about 90% of the market share in AI chips as interest in the technology has soared and GPUs have become crucial to building AI models.

The company's success in the budding sector led to a glowing second quarter of 2024 (ended July 2023). Nvidia's revenue climbed 101% to $13.5 billion, with operating income rising over 1,200% as AI chip sales spiked.

Nvidia has hit some roadblocks over the last year as rising tensions between the U.S. and China have meant increased sanctions on the sales of high-performance chips to the East Asian country. However, the company has been quick to react. Rather than losing out on a major market, Nvidia has developed three new chips tailored specifically for China that can meet the rising demand for AI in the region and comply with U.S. export controls.

Nvidia has enjoyed immense growth over the last year but has shown no signs of slowing. Chip demand will likely continue rising over the long term, with Nvidia well-positioned to profit significantly as it does. Its stock is a solid buy for anyone looking for an investment to hold until retirement.

2. Apple

Apple (AAPL -0.35%) hasn't had it easy this year. Macroeconomic headwinds have caught up with the company, causing significant reductions in consumer spending and sales declines across all four of its product segments in fiscal 2023. Revenue fell 3% year over year after net sales tumbled 2% in its iPhone segment (the highest-earning part of its business).

The challenges have led to some pullback from investors, with Apple shares down 5% since the end of July. However, economic hurdles won't last forever, and the company's dominance in tech remains an attractive selling point over the long term. Apple holds leading market share in most of its product categories, with quickly expanding positions in digital services and AI.

Despite market headwinds, Apple has actually grown its market share in smartphones this year as consumers have continued to prefer its products. From the first quarter of 2023 to Q3, Apple's market share grew from 52% to 55% (per Counterpoint Research). The company has gotten ahead by consistently outperforming its smartphone competitors. In Q3 2023, Samsung and Alphabet sales fell 26% and 37% as total U.S. shipments plunged 19%. However, Apple reported a more moderate decline of 11%.

Moreover, the tech giant's booming services business has become its second-highest-earning division, and is outpacing its iPhone segment in growth. In fiscal 2023, services revenue rose 9% year over compared to the iPhone's decline of 2%. The digital business includes income from the App Store and its subscription-based platforms, which have proven far less vulnerable to economic declines than products. The segment's rapid growth bodes well for Apple over the long term as it will allow it to lean less on product sales, especially during temporary market declines.

Apple shares have soared 265% since 2018, more than those of competitors like Microsoft, Alphabet, and Amazon. Despite recent hurdles, I wouldn't bet against its stock rising far higher over the next few decades as it expands in more digital markets and benefits from a recovery in the consumer tech market.