There are two things you can do with money: save it or spend it.

In fact, the percentage of your income you save may be the single biggest determinant of when you can retire. The higher the percentage of income you save, the sooner you'll be able to retire. And that's not just because you're saving more, but because you're spending less too.

Finding that balance can be the most important factor in planning for your retirement.

The most important retirement table you'll ever see

If you look at the table below, you'll see how a higher savings rate produces a faster path to retirement, assuming you're starting from nothing.

Savings Rate Years Until Retirement Assuming Annual Returns of:
  5% 7% 9%
5% 65.8 52.2 43.8
10% 51.4 41.7 35.5
15% 42.8 35.3 30.4
20% 36.7 30.7 26.7
25% 31.9 27.1 23.8
30% 28.0 24.0 21.3
35% 24.6 21.4 19.1
40% 21.6 19.0 17.1
45% 19.0 16.9 15.3
50% 16.6 15.0 13.7
60% 12.4 11.4 10.6
70% 8.8 8.3 7.8
80% 5.6 5.4 5.2
90% 2.7 2.6 2.6

Data source: Calculations by author.

I can't take credit for this idea. I first saw a table like this on Mr. Money Mustache's website.

The math relies on the 4% rule. It assumes that you need 25 times your annual spending, which is defined as the amount you're not saving.

I've expanded the table to show the impact of various market returns on the time until retirement. That provides an additional insight into the formula for how long it takes to retire at various savings rates.

As you can see, the lower your savings rate (and the further you are from retirement), the bigger the impact of market returns on your time until retirement. That's because compounding has a much bigger impact on your retirement savings over 40 years than it does over five years.

The takeaway here is that the further away you are from retirement, the more it makes sense to invest aggressively in assets with long-term time horizons. The closer your are to retirement, the more you should focus on capital preservation.

A hand stacking quarters next to a wooden alarm clock decoration.

Image source: Getty Images.

This is just a starting point

The table above is only good as a point of reference. It has a few shortcomings that you need to be aware of.

First of all, it presumes a steady rate of return on your investments. Anyone who's ever looked at a stock chart knows the markets don't return the same amount to investors year in and year out. While the S&P 500 has returned a real compound average return of 7.4% since the end of World War II, it certainly hasn't gone up in a straight line.

The sequence of returns on your investments can have a significant impact on your retirement savings after a few decades.

Not only are market returns lumpy, life is lumpy too. Your expenses won't stay the same year in and year out. What's more, your income won't stay the same either. Your savings rate is likely to fluctuate over time as your earnings increase and your expenses change. On top of that, your expenses are likely to change in retirement as well.

But the above chart provides a great baseline. If you want to retire in 25 years and you don't have any savings yet, aim to save around 30% of your income. You may need to save a higher percentage in the future as you get raises to meet that goal, but not so much that you won't be able to increase your spending too.

If you know your savings rate, even if you expect it will change over time, you're well on your way to a successful retirement plan.