There's no question that the "Magnificent Seven" dominated the stock market narrative last year. A combination of dirt-cheap valuations in the tech sector and an artificial intelligence (AI) boom ignited by ChatGPT sent investors rushing into tech stocks, especially the sector leaders that are likely to shape the AI revolution.

If you're wondering why the Magnificent Seven earned the name "magnificent," all you have to do is look at their returns. All seven of the stocks beat the S&P 500 (^GSPC 1.02%) by a wide margin in 2023, and three of them even doubled last year. 

^SPX Chart

^SPX data by YCharts

Along with the talk about the Magnificent Seven, you might have heard that those stocks were largely responsible for the S&P 500's gains. While there's some truth to that as those seven stocks delivered a market cap-weighted-average return of close to 100% last year, it's also a mistake to think that those were the only stocks that beat the S&P 500's 24% return.

Over the past year, 135 S&P 500 stocks outperformed the S&P 500, meaning that 128 stocks that aren't included in the Magnificent Seven still beat the S&P 500.

While the tech sector's performance was particularly strong last year with the Nasdaq Composite's 43% gain, there were several other big winners last year from other sectors. Let's look at a few of those top stocks.

A stock market chart going up.

Image source: Getty Images.

S&P 500 stocks you didn't know doubled last year

You probably didn't hear much about Builders FirstSource (BLDR 1.29%) last year, but the building materials supplier's stock price quietly jumped 157% last year.

The company sells a wide range of residential construction products, including drywall, doors, windows, and countertops, through 570 locations in 43 states. Its growth has been driven by organic demand for materials caused by the nationwide housing shortage and through a roll-up strategy in which it's made several acquisitions in recent years.

The company was also added to the S&P 500 at the end of 2023, which fueled its gains along with signs that the Federal Reserve would lower interest rates in 2024.

Another top stock last year was Royal Caribbean Cruises (RCL 2.27%). The cruise line operator rode a broad comeback in the industry as demand for cruises surged in the reopening from the pandemic, and the stock price finished the year up 162%.

Royal Caribbean stock plunged during the pandemic as cruise ships were grounded for nearly a year, but profit surged this year, with a $2.3 billion operating income on $10.6 billion in revenue through the first three quarters. As a result, the stock is back near all-time highs.

Finally, Uber Technologies (UBER -0.38%) was another pandemic recovery story that shined last year, with the stock price jumping 149%. Uber's efforts to control costs have paid off, as its profit soared and it gained admission to the S&P 500. In the third quarter, it reported operating income of $394 million on $9.3 billion in revenue, on the basis of generally accepted accounting principles (GAAP). https://investor.uber.com/news-events/news/press-release-details/2023/Uber-Announces-Results-for-Third-Quarter-2023/default.aspx

The ride-sharing giant is still growing steadily and has eliminated many of the distractions that plagued the business earlier. Uber also seems well-positioned to benefit from a lower interest rate environment.

The lesson for investors

It's a common refrain that only a handful of stocks have driven most of the market's gains over the long term, much as the Magnificent Seven did last year.

That observation isn't wrong, but it deserves some clarification because there are a large number of losers and underperformers in the stock market. Even over the past year, 190 of the S&P 500's stocks, or nearly 40%, saw their prices decline even as the index has climbed more than 20%.

However, there are more winners to choose from than you might think, and new bull markets typically broaden out as they mature, so we should see more new winners this year.

The numbers here are a reminder that you can make money investing in a Magnificent Seven stock, or you can find an overlooked option such as Builders FirstSource. It's a mistake to think there are only a few stocks that will beat the market this year.