Some people spend their whole lives working toward a seven-figure savings.
But it’s undoubtedly easier to reach millionaire status if you have a high-earning job that allows you to sock away more of your income.
In fact, a Fidelity Investments report cited by the New York Times found that the typical “401(k) millionaire” was an American with a six-figure income — $287,700 for women and $354,600 for men.
On average, women hit the milestone at age 58.5, while the average man became a millionaire at age 59.3. That’s several years before the full retirement age of 67, but depending on how much money you plan to spend annually in retirement, $1 million may just be the tip of the iceberg.
Fidelity says there are 133,000 401(k) millionaires on its platform, which oversees retirement accounts for more than 15 million Americans. Notably, women now represent about 20% of Fidelity’s 401(k) millionaires, nearly double the share of women 12 years ago.
But you don’t have to be a high earner to become a 401(k) millionaire. In fact, Fidelity found that saving consistently and investing in the stock market were the keys for those who reached millionaire status while earning less than $150,000.
For those mid-level earners, women had a savings rate of nearly 25% — 18.1% of their salaries and 6.8% employer match. By contrast, men earning less than $150,000 who reached millionaire status saved 22.8% total. Still, men earned about $1,800 more than women annually, according to Fidelity.
Perhaps most importantly, the stock market was the preferred choice of investment. Men and women who became 401(k) millionaires held the majority of their savings — 76% and 77%, respectively — in stocks.
Ultimately, those who start investing in their 20s, no matter the amount, will be better off. Fidelity found it takes about thirty years of working and saving to reach the milestone.
Younger investors can take advantage of compound interest and have more time for investments to bounce back from downturns in the market. The S&P 500 has averaged an 11% annual return since 1966, but even a more conservative expected return of 5% can make a difference in your retirement savings.
And while the $1 million mark is something of an accomplishment, you may need more than that to live comfortably in retirement, or even quit work early. A nest egg of $1 million provides annual retirement income of about $40,000, using a 4% withdrawal strategy.
To find your magic number, or retirement savings goal, all it takes is a simple calculation: determine your desired annual retirement income and divide it by 4% (the maximum amount you will withdraw from your savings each year to pay for your living expenses in retirement).
Once you know that number — whether it’s $1 million or more— you can leave work as soon as you reach it.
This article originally appeared on BusinessInsider.com.