People save money for many reasons, but most people ultimately want the same thing: financial independence. And the stock market has historically been the best path to building life-changing wealth. Since 1928, the total return of the S&P 500 has easily topped the performance of treasury notes, corporate bonds, and real estate, and there is no reason to believe that trend will change.

Of course, some investment strategies involve far more risk than others, but it is possible to build a $1 million portfolio by investing just $100 per week without taking on unnecessary risk. Here's how.

Step 1: Create an emergency fund

Before putting a dime in the market, investors need to have an emergency fund. Murphy's Law says it all: If anything can go wrong, it will go wrong. People lose their jobs, cars break down, and medical emergencies arise. Navigating those unforeseen events can be expensive, and the last thing you want to do is sell stocks to come up with cash.

Why not sell stocks? The market can be volatile over short periods of time. The current downturn is a perfect example. The S&P 500 is 17% off its high, and many individual stocks have fallen even further. That means an investor without an emergency fund right now would be forced to sell during this down market, depriving themselves of the wealth they would have realized when the market rebounds.

How much money goes into an emergency fund? Most experts say three to six months' worth of living expenses is ideal, so the number will vary from one person to the next. That being said, some people may be more comfortable with a larger pile of cash.

Step 2: Invest on a regular basis (and hold for the long term)

The secret to making money in the stock market is frequent contributions and a long-term mindset. A buy-and-hold strategy paired with regular investments eliminates short-term noise, and it increases the odds of turning a profit.

The following chart illustrates how different holding periods impact the probability of a positive return in the S&P 500.

Holding Period

Probability of Positive Return

1 month

63%

1 year

75%

10 years

94%

20 years

100%

Data source: Fisher Investments. Note: based on data collected between 1926 and 2017.

Building on that idea, the S&P 500 has generated a total return of 1,630% over the last three decades, which is roughly equivalent to 10% per year. At that pace, $100 invested in an S&P 500 index fund on a weekly basis would be worth about $1.1 million in 32 years. Even more impressive, that figure would hit $2.4 million after 40 years.

Of course, some people may not be able to afford to invest $100 per week, and others may want to invest more. That's OK! The chart below shows how long it would take to accumulate $1 million based on different weekly contributions to an S&P 500 index fund, assuming a return of 10% per year.

Amount Invested Per Week

Time to Build a $1 Million Portfolio

$25

46 years

$50

39 years

$75

35 years

$100

32 years

$200

25 years

$300

21 years

Data source: Bankrate. Note: time is rounded up to the nearest year.

An S&P 500 index fund may sound boring compared to buying individual stocks, but boring is often good when it comes to investing. With an S&P 500 index fund, you benefit from instant diversification, because your investment is spread across 500 of the largest U.S. companies. Better yet, while the S&P 500 has seen dozens of downturns over the years, the index has always recouped its losses and gone on to hit new highs.

To clarify, I am not advocating against investing in individual stocks, which make up the majority of my own portfolio. But putting $100 each week (or whatever you can afford) into an S&P 500 index fund is a less risky path to achieving financial independence. And with the S&P 500 down 17% from its high, now is a great time to get started.