Before you can start planning for retirement, you need to set a goal for how much you need to save.

Determining how much you need for retirement isn't an exact science, though. You might be familiar with rules of thumb: "you should be able to replace 80% of your pre-retirement income" or "you should have 10 times your final year's salary in investments." But those rules are problematic for several reasons, least of which is that it's impossible to know how much you'll be earning in your 60s if retirement is still decades away.

Relying on a one-sentence rule that makes sense for everyone's retirement will never work. That's why it's better to have a framework for determining how much you'll need in retirement.

Here's how to calculate exactly how much money you'll need in retirement in three simple steps.

An advisor points to a chart on a piece of paper while two other people watch.

Image source: Getty Images.

Step 1: Estimate a budget

This is by far the hardest part in determining how much you'll need in retirement.

The farther away you are from retirement, the more difficult this is going to be. But you can use reasonable estimates for figuring out a ballpark range, and an estimate will do for now. As you get closer to retirement, you can adjust and narrow your estimates to hone in on your goal.

You should revisit your retirement budget estimate every few years or whenever you have a major life change to make sure it still makes sense.

To start, you should get an idea of how much you're spending right now. If you don't know, go back through the last few months of credit card and bank statements to get a rough idea of how much you currently spend on an annual basis.

From there, you can adjust your budget based on how you'd expect things to change in retirement. If you're going to pay off your mortgage by then, that's a huge expense you'll take off your plate. If you no longer have a job you need to commute to, you can probably save money on gas and car insurance.

There are also some additions to the budget. Many people travel more in the early years of retirement. And in their later years, they need to spend a lot more on medical care.

Once you have a rough estimate of how much you'll spend in retirement, you're ready to move on to the next step. But as mentioned, be sure to come back periodically and review your budget estimate as your picture of retirement becomes clearer.

Step 2: Determine a safe withdrawal rate

A safe withdrawal rate is the amount you can withdraw from your retirement savings every year with a reasonable expectation you won't run out of money. It's essential for determining how much you'll need to save for retirement.

Many retirement planners point to the 4% rule, developed about 30 years ago by financial advisor Bill Bengen. He found that a retiree with a portfolio split evenly between stocks and medium-term Treasury bonds can withdraw 4% of the starting portfolio balance every year while adjusting for inflation. Doing so provides a very high likelihood you won't run out of money within 30 years. In fact, you'll often end up with more than you started with.

The 4% rule offers a great starting point for retirement planning. You may want to adjust that safe withdrawal rate, however, based on several factors.

First, if you're planning for a shorter retirement, you can use a higher withdrawal rate. That said, you may only be able to boost it by a quarter or half a percentage point, as the biggest period of risk is right after you retire. Likewise, if you're planning for a longer retirement, you'll need to lower your safe withdrawal rate. Again, you don't have to lower it too much.

You may be able to use a higher withdrawal rate if you're willing to adjust your withdrawal downward in the case of a poor sequence of returns early in retirement. Leaving room for adjustments could allow you to start with a withdrawal rate of 5% or more, according to recent research.

In general, you'll likely settle on a withdrawal rate between 3.2% and 5.0%. If you're conservative, err on the low end.

Step 3: Calculate your number

With an approximate budget and your safe withdrawal rate, you have everything you need to determine the exact amount you'll need for retirement (at least as things stand today).

Simply take your estimate for your retirement budget and divide it by your safe withdrawal rate. For example, if your retirement budget is $60,000 and your safe withdrawal rate is 4%, you'll need $1.5 million to retire.

The next step is to figure out a plan to reach that savings goal before it's time to retire.

While you'll periodically need to revisit your numbers as things change and the picture of your retirement comes into focus, this framework is the best way to determine exactly how much you'll need in retirement.