Many people invest because they want passive income. After all, who doesn't want to earn money doing nothing? But if you use your investments to generate income early on, you could be missing out on the chance to build serious wealth.

If you forgo passive income and reinvest your earnings, you can tap into the magic of compounding. Read on to learn how compounding can grow small amounts of money into a substantial nest egg over time.

A person relaxes on a yacht.

Image source: Getty Images.

Passive income vs. compounding

Passive income is money you make with little to no regular effort. There are countless ways to generate passive income. For instance, you could write a best-selling book and watch those royalty checks roll in, or you could buy rental properties, though either example requires significant time or money up front.

Another way to earn passive income is by investing. Technically, in investing, passive income refers to income generated from the investment, such as stock dividends or bond coupon payments, that you earn if you don't sell the investment. But you can earn both passive income and capital gains from investing in the stock market.

If you want to get rich from stocks, you're not going to want to use that money for income right away. Instead, you'd reinvest your money to generate compound returns. Essentially, the money you earn then earns even more money. Over long stretches of time, your money can grow exponentially.

Here's an example of how compounding works. Suppose you invested $10,000 in an S&P 500 index fund, like the Vanguard S&P 500 ETF (VOO -0.90%). Your money earns 10% each year through capital gains and dividends, which is right around the index's historical average.

Instead of withdrawing the $1,000 your money earns over the first year, you leave it where it is. By the end of year one, you have $11,000, which may not sound too impressive. But compounding needs time to work its magic.

Let's assume you never add a dime to your $10,000 principal. But year after year, you reinvest your 10% gains. Here's how much you'd have -- all thanks to compounding: 

  • After 10 years: $25,937
  • After 20 years: $67,275
  • After 30 years: $174,494

How compounding works in the real world

Most people don't dump $10,000 into the stock market and then never invest again. Instead, you might practice dollar-cost averaging by investing smaller amounts each month in your 401(k) or individual retirement account (IRA). Consistent investing combined with compound earnings will propel your returns even further.

Imagine you invested $10,000 in the same S&P 500 index fund that earned 10% annual returns, only you decide to invest $100 a month on top of that and then reinvest those earnings as well. Here's how your $10,000 initial investment, plus that extra $100 per month, would grow:

  • After 10 years: $45,062
  • After 20 years: $136,005
  • After 30 years: $371,886

As you can see, compounding is most powerful over long periods of time. There's no way around the fact that the later you start investing, the less time your money has to grow. That means you either have to invest more or make do with a smaller nest egg. Or you may need to retire later so your money has ample time to compound.

When should you use investments for income?

If you're like most people, the goal of investing is to grow your money so you can actually spend it someday. But it's typically best to let your money grow until you need the income or you reach the age when required minimum distributions (RMDs) begin for your retirement accounts.

The power of compounding may not impress you if you're only thinking short term. But long-term investing is what creates wealth. So kick back and allow those compound returns to make your investment portfolio soar.