If you want to create a solid retirement savings plan, you need an idea of how much you'll actually need to retire.

You may have heard of certain rules. For example, it's often recommended you should be able to replace 80% of your pre-retirement income, or you should have 10 to 12 times your final year's income saved. Both rules are problematic for several reasons. (How do you even know what your final work year's salary will be when you're in your 20s?)

More importantly, personal finance is personal. One-size-fits-all rules like that don't consider how much you spend or how long you can expect retirement to last. That's why a framework, not a rule, is a better way to calculate the amount of money you'll need in retirement. Here's how to do it.

Person with hands under chin, staring off into the distance.

Image source: Getty Images.

Estimate a budget

A budget is the crux of determining the amount you'll need in retirement. The further away you are from retirement age, the more difficult it will be.

For established professionals, a good starting point is determining how much you're spending right now. If you don't know, go back through all your credit card and bank statements for the last three months, add up all your expenses, and use that to create a rough estimate for your annual spending.

Next, you'll have to adjust for expenses you expect to increase or decrease in retirement.

If you expect to pay off your mortgage prior to retirement, that's a huge expense going out the door. If you're not commuting to work, you probably won't spend as much on transportation, and you might be able to get rid of a car.

On the other hand, you might want to travel more. And one of the biggest expenses in anyone's golden years is healthcare. Medicare premiums and out-of-pocket expenses add up. The average 65-year-old retiree needs an extra $181,500 to cover their medical expenses in retirement, according to a study from the Employee Benefit Research Institute earlier this year.

Your budget will be a rough estimate. The further away you are from retirement, the rougher it will be. It's important to come back and redo this exercise to calculate your expected retirement budget as you experience life changes.

For now, though, your best guess is the best you have to go on.

Determine your safe withdrawal rate

A safe withdrawal rate is the maximum percentage you can withdraw from your retirement portfolio's beginning balance on an annual basis with a reasonable expectation of not running out of money. For example, if you retire with $1 million and determine your safe withdrawal rate is 4%, you can withdraw $40,000 every year and make annual adjustments for inflation.

4% is generally a good starting point. The 4% rule states that a portfolio consisting of 50% stocks and 50% intermediate-term Treasuries has a 95% chance of lasting through a 30-year retirement with a 4% safe withdrawal rate.

If your retirement is shorter, you may want to increase your safe withdrawal rate a little but not too much. The biggest period of risk for retirement savings is the early years right after retirement.

If you expect your retirement will be longer, you may want to consider a slightly lower withdrawal rate. Note, a 3% withdrawal rate is pretty much rock solid for any length of time.

Calculate your number

With an approximate budget and safe withdrawal rate, you're ready to calculate your retirement savings goal.

The formula is simple: Take your retirement budget and divide it by your safe withdrawal rate. That's it. The next step is to figure out a plan to get to that number.

Remember, your retirement budget is going to be a moving target. As you gain more clarity about what you'll need and want in retirement, be sure to adjust your plan accordingly.