Investing in the stock market is one of the most effective ways to generate long-term wealth, but it can be daunting -- especially if you're a beginner.

The good news, though, is that you don't need to be a stock market expert or have thousands of dollars per month to invest. In fact, with just $100 per month, you could potentially build a portfolio worth $325,000 or more. Here's exactly how to get there.

Choosing the right investments

Where you invest is far more important than how much you can afford to invest each month. If you're investing in shaky stocks, it doesn't matter how many thousands of dollars you're contributing -- you could still lose far more than you gain.

Person holding hundred-dollar bills.

Image source: Getty Images.

If you're willing to put in some time and effort, investing in individual stocks could be a smart strategy. This approach requires a bit of research to ensure you're buying quality companies, but if done well, you're much more likely to earn above-average returns over time.

Individual stocks aren't the only way to invest, however. If you're looking for a more effortless option, broad-market ETFs -- such as an S&P 500 ETF -- can be a better fit. Each ETF contains dozens or even hundreds of stocks, providing instant diversification with next to no effort on your part.

S&P 500 ETFs, in particular, can be a good fit for risk-averse investors looking for a low-maintenance investment. This type of fund tracks the S&P 500 index itself, containing stocks from all 500 companies within the index. S&P 500 ETFs are among the lowest-risk funds, and you're all but guaranteed to see positive returns over the long haul.

Building a $325,000 portfolio

The returns you earn will depend largely on where you invest. Historically, though, the market itself has earned an average annual return of around 10% per year -- meaning the annual highs and lows have averaged out to around 10% per year over several decades.

For simplicity's sake, let's assume you're investing in an S&P 500 ETF, earning a 10% average annual return. If you're investing $100 per month, here's approximately how much you could accumulate over time, depending on how many years you have to save:

Number of Years Total Portfolio Value
20 $69,000
25 $118,000
30 $197,000
35 $325,000
40 $531,000

Data source: Investor.gov. Table by author.

To reach $325,000 in total savings, you'll need to invest consistently for around 35 years. But if you have even a few more years to invest, you could potentially earn far more.

Again, these numbers assume you're earning returns in line with the market's historic average. If your investments are beating the market even slightly, it's possible to earn much more over time.

For instance, say your investments are earning a 12% average annual return compared to 10% per year. If you're still investing $100 per month, you'd have a total of around $518,000 after 35 years, compared to $325,000 in that time period with a 10% return.

There are never any guarantees in the stock market, but with the right strategy, a little cash can go a long way. By choosing the right investments and getting started as soon as possible, you could build a portfolio worth hundreds of thousands of dollars.