A group of technology giants dubbed the "Magnificent Seven" was responsible for a large proportion of the 26.3% gain in the S&P 500 last year. That's because their collective valuation of $12 trillion makes up 28% of the index, so they have a huge influence over the direction of the broader market.

These are the Magnificent Seven stocks, and how they performed in 2023:

NVDA Total Return Price Chart

Total Return Price data by YCharts

The Equal Weight S&P 500 index -- which assigns an identical weighting to all 500 stocks -- finished 2023 with a gain of just 11.5%. It highlights just how impactful the surging Magnificent Seven returns were on the actual S&P 500. If you didn't own that group of stocks last year, your portfolio probably lagged the market.

But it's not all about blockbuster gains, because some of the Magnificent Seven stocks also pay dividends. I'm going to show you how much you could earn with a $350,000 investment split equally across the seven stocks.

Artificial intelligence, cloud computing, electric vehicles, and more

The Magnificent Seven companies operate across every major segment of the technology sector. Artificial intelligence (AI) was the largest driver of value in 2023, which is why Nvidia (NVDA 6.18%) led the group higher. Its H100 and upcoming H200 data center chips are designed to process AI workloads, and demand continues to surge as more businesses seek to develop AI applications.

Amazon (AMZN 3.43%), Microsoft (MSFT 1.82%), and Alphabet (GOOGL 10.22%) (GOOG 9.96%) are some of the world's largest data center operators, and therefore some of Nvidia's biggest customers. They use those centralized data centers to deliver cloud services -- and the computing power necessary to develop AI -- to millions of businesses around the world. Plus, Amazon, Microsoft, and Alphabet offer cloud customers a growing number of large language models (LLMs), which are the building blocks of many AI applications.

Meta Platforms (META 0.43%) is using AI to show more relevant content to each of its 3.1 billion monthly users. The company also created an LLM of its own called Llama, which is open source, so any developer can use it to build advanced AI applications.

Apple (AAPL -0.35%) created its own LLM in-house, which it's using to develop an AI chatbot similar to ChatGPT. It will pair nicely with the company's latest iPhone 15, because it's fitted with the Apple-designed A17 Pro chip, which is capable of processing AI workloads on-device. This will place AI at the fingertips of billions of people around the world.

Finally, Tesla (TSLA -1.11%) was the world's leading electric vehicle company by sales up until the end of 2023, when it was edged out by China-based BYD. However, Tesla's future will likely be determined by the success of its AI-powered autonomous self-driving vehicle technology. It's yet to be publicly released, but it has the potential to transform the company's economics.

A digital render of a circuit board with a chip in the center, inscribed with the letters AI.

Image source: Getty Images.

Three of the Magnificent Seven stocks pay dividends

Some companies generate so much profit they can't possibly reinvest it all into their operations to fuel more growth, so they pay some of it to shareholders instead. Dividends are the most common form of distribution, and they usually come as quarterly cash payments.

Apple, Microsoft, and Nvidia are the only three Magnificent Seven stocks that pay dividends. Each of them less than a 1% yield, which are the payouts investors can expect to receive annually, calculated based on the value of their holdings.

MSFT Dividend Yield Chart

Dividend Yield data by YCharts

Yields often change. If a stock doubles, its yield will halve organically unless the company raises its dividend. It doesn't mean the payout shrinks in dollar terms, but it falls as a percentage of the value of your investment.

Microsoft offers the highest yield, and while it seems small at face value, it translates to around $20 billion in dividend payments each year based on its current market capitalization of $2.8 trillion.

If you'd invested $350,000 in the Magnificent Seven (split equally with $50,000 invested into each stock) you would earn a dividend yield of 0.37% on $150,000, and no yield on the other $200,000. That translates to an effective yield of 0.18% on the $350,000, or an annual payment of $659.56.

It's a paltry sum given the yield investors can earn on cash in a savings account right now, but it's a nice bonus on top of the spectacular capital growth these stocks have delivered over the past year.

Dividends aren't the only form of distribution

A dividend isn't the only way companies return money to shareholders. They can also execute stock buyback programs, where they purchase their own shares on the open market. Those shrink the number of available shares in circulation, which leads to a higher price per share.

Stock buybacks are preferable to dividends for many companies, because they give them the flexibility to distribute the money at a time of their choosing -- they aren't locked into paying out a specified sum each quarter.

Five of the Magnificent Seven companies have active share repurchase programs, worth a combined $186.6 billion over the last 12 months. Tesla and Amazon are the two without active programs.

AAPL Stock Buybacks (TTM) Chart

Stock Buybacks (TTM) data by YCharts

Are the Magnificent Seven stocks still a buy now?

As I touched on at the top, investors who didn't own the Magnificent Seven stocks in 2023 likely underperformed the S&P 500 index. The law of large numbers makes it somewhat counterintuitive to expect these enormous companies to continue delivering the best returns in the entire market, because it gets harder for them to grow their revenue and earnings each year.

However, it so happens that the Magnificent Seven companies operate at the forefront of the fastest growing industries in the world. For any investor seeking exposure to technologies like AI, cloud computing, e-commerce, digital advertising, or electric vehicles, it's nearly impossible to look past these stocks.

Depending on which Wall Street forecast you rely on, AI alone could add between $7 trillion and $200 trillion to the global economy in the coming decade. Each of the Magnificent Seven already has a foothold in the industry, and they will likely deploy their considerable financial resources to ensure they capture a large slice of the opportunity.

Therefore, the Magnificent Seven will likely be a great place for investors to park their money for the long term, and any dividends earned are an added bonus.