When investing in the stock market, choosing the right stocks or funds is critical to building wealth while minimizing risk.

Exchange-traded funds (ETFs) can be a smart option for many people. Each ETF may contain dozens or hundreds of different companies, which can make investing easier and more affordable compared to buying individual stocks.

However, not all ETFs are created equal, and the right investment for you will depend on several factors. Two of the more popular funds include the Vanguard S&P 500 ETF (VOO -0.33%) and Invesco QQQ (QQQ -1.25%). Which one is the better fit for you? Here's what you need to know.

Person sitting on the floor looking at a laptop and documents while dog is resting on a couch in the background.

Image source: Getty Images.

VOO: Pros and cons

The Vanguard S&P 500 ETF is a fund that tracks the S&P 500 index. This means it includes the same stocks as the S&P 500, and it also matches its long-term performance.

There are several advantages to investing in this ETF. For one, it's instantly diversified. This fund includes roughly 500 stocks from some of the largest companies in the U.S., spanning a wide variety of industries. If a few stocks or even an entire industry doesn't perform well, it won't sink your entire portfolio.

In addition, you're more protected against stock market volatility with an S&P 500 ETF. No investments are immune to market downturns, but the S&P 500 has a long history of recovering from slumps. By investing in an S&P 500 ETF, it's highly likely your portfolio will rebound from a downturn as well.

Perhaps the biggest disadvantage of this fund is that you can't earn above-average returns. The S&P 500 is one of the best representations of the market as a whole. Because this ETF simply follows the market, it's impossible for it to beat the market.

QQQ: Pros and cons

Invesco QQQ is a tech-focused ETF that includes just over 100 stocks from the technology sector. It was established in 1999, making it one of the older ETFs in existence.

Because tech stocks often experience rapid growth, this ETF has the potential for higher-than-average returns. In fact, it's earned an average annual return of nearly 23% per year over the last 10 years compared to VOO's average return of around 14% per year in the same time frame.

With higher returns, though, sometimes comes higher levels of risk. Because this fund only includes stocks from one industry, it's not as diversified as VOO. During downturns like the most recent tech sell-off, this ETF is often hit harder than broad-market funds that are more diversified.

For that reason, it's wise to invest in other stocks or funds in addition to QQQ. While this ETF can earn higher returns, having more diversified investments in your portfolio will also help limit your risk.

Which option is best for you?

When you're deciding whether to add VOO or QQQ to your portfolio, consider your investing goals and tolerance for risk.

If you want a single diversified investment that may not earn as much but carries less risk, VOO may be your best. On the other hand, if you're willing to take on more risk for the chance at earning higher returns, QQQ could be a solid addition to your investments.

There's no one-size-fits-all answer as to where you should invest, and all ETFs have their advantages and disadvantages. By weighing your options and thinking about your preferences, it will be easier to decide which investment is best for you.