Investing in the stock market is a fantastic way to generate long-term wealth, and even small amounts can go a long way -- with the right strategy.

By getting started early, choosing the right investments, and investing even a little each month, you can build a portfolio worth hundreds of thousands of dollars or more. Here's exactly how you can turn just $50 per month into $100,000 in the stock market.

Person holding hundred dollar bills.

Image source: Getty Images

Step 1: Get started early

Time is your most valuable resource when investing in the stock market. Thanks to compound earnings, your money will grow exponentially faster the more time it has to accumulate.

The sooner you get started, then, the less you'll need to invest each month to build a robust portfolio. Even if you don't have much cash to spare right now, it's still better to get started than to put it off. You can always invest more later, but you'll never get this time back.

Step 2: Choose the right investments

There's no single correct way to invest, so the specific investments you choose will depend on your personal preferences and risk tolerance.

If you're willing to put in a bit of effort, investing in individual stocks may be a smart option. You will need to spend time researching companies and keeping up with industry trends, because investing in the wrong places could be incredibly costly. But if you invest wisely, you could earn much higher-than-average returns.

If you'd prefer a hands-off type of investment, a simple S&P 500 index fund or ETF may be a better fit. The downside to this type of investment is that it can only earn average returns, as it's designed to follow the market. However, it requires next to no effort on your part, and it's also generally less risky than investing in individual stocks.

Step 3: Invest consistently

Consistency is key to maximizing your returns in the stock market. While you can still make a lot of money with just one initial investment, you can earn far more over time by investing on a regular basis.

Let's say you're investing in an S&P 500 index fund earning an average rate of return of around 10% per year -- which is in line with the stock market's historic average. If you were to invest just $50 per month, here's how your savings could add up over time:

Number of Years Total Savings
20 $34,000
25 $59,000
30 $99,000
35 $163,000
40 $266,000

Source: Author's calculations via Investor.gov

To reach the $100,000 mark, you'd need to invest consistently for around 30 years. But if you have even a few more years to save, you could potentially earn far more.

Again, these figures assume you're earning returns in line with the market's historic average. If you're investing in individual stocks or any other investment earning higher-than-average returns, you may be able to earn much more than these figures over the long haul. Then again, the same goes for investments that earn lower-than-average returns.

Regardless of where you choose to invest, time and consistency are crucial to building wealth in the stock market. By getting started now and investing as much as you can afford on a regular basis, you could earn more than you might think.