If you're like most people, you know you must save something for retirement -- but you probably don't know exactly how much. As many as 81% of all Americans don't know what amount of money they'll need to retire, which may explain why only around 18% of us are confident we'll have enough. 

If you want to make sure you don't run out of money, the first step is setting a savings goal. This simple, four-step guide will show you how to determine exactly what you need to save so you can look forward to retirement with the certainty that you won't run out of cash. 

Senior couple on beach

Image Source: Getty Images.

1. Estimate what you'll need to spend each year during retirement

Your retirement income must provide enough for you to live on -- which means you need to know how much you'll live on. One rule of thumb is to assume you'll spend 70% of the income you earned when working. If your salary is $80,000 right now, then you'd need $56,000. 

However, this rule of thumb typically only works if your mortgage is paid off, you don't have high medical bills, and you're not jetting around the globe on a senior world tour. If you'll still be in debt, if you're in poor health, or if you plan to move to indulge expensive hobbies, then you actually may end up spending more than when you were working. 

To arrive at a reasonable estimate, consider how your current expenses will change and create a "sample budget" for retirement living. If your mortgage will be paid off but you'll take one costly trip each month, your costs may stay the same. Don't forget to consider potential health expenses as you get older, as a senior couple with high prescription drug costs could spend as much as $350,000 on medical care during retirement. 

2. Figure out what you'll be getting from your pension and Social Security

Calculating your expected budget is only half the equation. You also need to know how much money you'll have coming in.

Traditionally, there was a "three-legged" stool that supported seniors during retirement: Social Security, a defined-benefit pension plan from an employer, and savings. Savings are the only variable you can control, so figure out how much support the other two legs will provide.

Only 13% of private-sector workers had a defined-benefit pension plan as of 2013, but if you're one of the lucky ones with this type of guaranteed retirement income, talk with your plan administrator to find out what your expected pension benefits will be. Your age at retirement and the length of time you stay with the company impact the exact amount of pension benefits, but you should be able to get a workable estimate.

Social Security is another key source of income for most retirees, but given that the average monthly benefit for 2017 is only $1,360, you don't want this to be your only source of income. The Social Security Administration provides a calculator to determine what your benefits are likely to be. You can also create a Social Security account online to see your estimated benefit at your full retirement age based on your earnings record. 

When you add up your pension benefits and Social Security, don't factor in any investments in a 401(k) or IRA. Since you're trying to calculate how much you'll need to invest in these accounts to produce your desired income, see how much money you'll have without those accounts added in. 

3. Determine how much the gap is

Now that you know how much you'll be spending and what your pension and Social Security income add up to, determine how big of a gap there is between the money you'll have and the funding needed to support the lifestyle you'll lead. Your savings will have to make up the difference.

If you expect to need $56,000 annually during retirement and you earn the average Social Security benefit with no pension income, you have a $39,680 shortfall ($56,000 - $1,360 x 12). The amount you save will need to produce this amount of annual income. 

4. Determine what you'll need to save to cover that gap

Ideally, you want your investments to produce enough income to cover the gap without having to take any money from the principal. If you can do this, you don't need to worry about running out of cash. Your principal balance will remain invested in something safe while you live on the income your investments earn. 

There are lots of different factors that affect the amount of income your investments produce, including your expected return on your investments. Once you're drawing from your retirement savings, you want to invest in something safe -- which means you can expect lower returns. 

To determine what you'll need to save, divide your shortfall by the returns you believe you'll earn, being conservative in your estimate. If you estimate you'll earn 4% annually, and your shortfall is $40,000, then divide $40,000 by .04 to get the magic number: $1 million. That amount would allow you to live comfortably without ever touching your principal (the amount you've personally invested, without returns included). Your principal can therefore serve as a cushion against market declines or unexpected financial hardship.

Many people do draw their principal down during retirement, with one common "rule" indicating that your savings should last 30 years or more if you withdraw 4% of your balance each year and then adjust that amount for inflation each year. This would mean you wouldn't have to save quite as much, as you'd use your principal to help you cover your income gap.

However, with the possibility of rising tax rates and rising healthcare costs in the future -- coupled with uncertainties about whether Social Security will cut benefits -- estimating you'll need a little more than expected is smart. You'll either reach your higher savings goal and live a more lavish lifestyle during retirement, or stay afloat in the event of a financial emergency.