If there's one thing the stock market is famous for, it's being incredibly volatile at times. That can make it unnerving to invest, especially in times like these.

However, the stock market is also a wealth-building powerhouse, and investing is one of the easiest and most effective ways to make a lot of money over time -- even if you can't afford to invest much right now.

In fact, with just a couple hundred dollars per month, the stock market can take you from zero to more than a quarter-million dollars with little effort on your part. Here's how.

A wealth-building machine

The primary reason to invest in the stock market is that you can take advantage of compound earnings.

With compound earnings, you're earning returns on your entire account balance rather than just your initial investment. As your savings grow, you'll earn more in returns, which will increase your account balance, and the cycle continues.

This means you don't need to invest much to get started, but you do need to begin investing as early in life as possible. The more time you give your money to grow, the less you'll need to invest each month to accumulate hundreds of thousands of dollars.

The best investment to get started

The investments you choose will have a monumental effect on your total returns. While there's not necessarily a right or wrong way to invest, it's wise to stick to long-term investments that are more likely to earn positive returns over many years.

If you're new to the stock market or simply want a low-maintenance, low-risk investment, you can't go wrong with an S&P 500 exchange-traded fund (ETF) -- such as the Vanguard S&P 500 ETF (VOO -0.07%), for instance.

An S&P 500 ETF tracks the S&P 500 index itself, so it includes stocks from 500 of the largest and healthiest U.S. companies. This ETF is one of the safer investments out there, as these stocks are far more likely to survive market downturns and experience positive returns over time.

This type of investment also requires next to no effort on your part. You don't need to worry about choosing stocks, deciding when to buy or sell, or researching companies. Simply invest whatever you can afford each month, then let the ETF take care of the rest.

The Vanguard S&P 500 ETF is an especially great investment because of its extra low 0.03% expense ratio. This is one of the lowest expense ratios among all ETFs, and it could save you thousands of dollars in fees.

From $0 to $272,000

Historically, the S&P 500 itself has earned an average rate of return of around 10% per year. This doesn't mean you'll earn 10% returns year after year (in fact, it's highly unlikely that will happen). However, the highs and lows each year should average out to around 10% per year over decades.

To play it extra safe, though, let's assume your investments will only earn an 8% average annual return. If you were to invest $200 per month while earning an 8% average annual return, you'd accumulate roughly $271,900 within 30 years.

To supercharge your savings, you can invest just a little more each month. Assuming you're still earning an 8% average annual return, here's approximately how much you could earn within 30 years, depending on how much you invest per month:

Amount Invested per Month Total Savings
$300 $408,000
$400 $544,000
$500 $680,000
$600 $816,000

Data source: Author's calculations via Investor.gov.

Even more important than the amount you invest per month, though, is the number of years you give your money to grow.

Say, for example, you're still only investing $200 per month and earning an 8% average annual return. But rather than investing for 30 years, you give your money 40 years to grow. In that case, you'd earn a whopping $622,000 in total -- or an additional $350,000 in just 10 years.

Regardless of how much you can invest each month or how many years you have to save, it's wise to get started now. The earlier you begin investing, the better your chances of earning hundreds of thousands of dollars or more.