The "Magnificent Seven" stocks have garnered a lot of attention over the past year as investors have become captivated with tech and growth stocks again. And there's good reason to be excited because these stocks make up the best and brightest of the market.

They also stand to benefit significantly from the emergence of artificial intelligence (AI). The Magnificent Seven are Alphabet, Amazon, Apple, Meta Platforms, Microsoft, Nvidia, and Tesla.

But as great as those tech stocks have been over the years, Bitcoin (BTC 1.58%) has still largely been the better investment over the past five years. During that time frame, it has generated impressive returns of more than 1,500%. And only one of the Magnificent Seven stocks has performed better over that stretch.

Bitcoin has been a better buy than six of the Magnificent Seven

The only one of the Magnificent Seven stocks that has outperformed Bitcoin in the past five years has been Nvidia, which is a name that has become synonymous with the boom in AI. The chipmaker is at the forefront of AI-related growth with its data centers and AI chips playing a pivotal role in the transformation of many businesses seeking to take advantage of the latest trends in tech.

But compared to all the other Magnificent Seven stocks, Bitcoin has easily outperformed them by a wide margin.

NVDA Chart

NVDA data by YCharts.

Why has Bitcoin been such a hot investment?

A big reason Bitcoin has done so well is that its starting point five years ago was relatively low. At the start of March 2019, it was trading at less than $4,000. Yesterday, it reached a new record -- $69,171.

Five years ago, the digital currency was coming off a big crash in 2018, and it wouldn't be until the meme hype of 2020 and 2021 where its valuation would take off again. Investing in an asset at a depressed valuation can give investors more potential upside in the long run. The trade-off is that there's normally a great deal of risk involved, since that's the reason it's trading at a low price to begin with.

But with investors growing more optimistic about the future of cryptocurrency, and some investors even treating it as a haven type of asset (as "digital gold"), its price has soared. And the anticipation and eventual launch of spot Bitcoin exchange-traded funds generated even more bullishness in crypto during the past year.

Five years ago, most of the Magnificent Seven stocks had market caps in excess of $100 billion. The two exceptions were Tesla and Nvidia, which have also been the best-performing stocks of the group since then.

Is Bitcoin still a good investment today?

The challenge with investing in Bitcoin is that it's a highly speculative investment and it's hard to gauge what its valuation will be in a year or two. There are plenty of optimists who believe it can go to $1 million, but there's also the possibility that regulators impose restrictions that inhibit its growth prospects and lead to a more depressed valuation.

Given the volatility surrounding crypto, it's not an investment I would feel comfortable holding. And unless you are willing to accept the high risk that comes with it as an investment and the possibility that you could lose all or most of your money, then you're still better off avoiding it.

Although there are catalysts, such as Bitcoin halving, which could drive the value of the digital coin higher this year, investors should be careful not to get caught up in the hype as the cryptocurrency has crashed before, and it could crash again.