21% of Americans don't have enough saved for retirement—this simple formula will show you if you're on track

This simple equation will tell you if you're saving enough for retirement

As a group, Americans have shockingly little saved for retirement.

Northwestern Mutual's 2018 Planning & Progress Study, which surveyed 2,003 adults, found that 21 percent of Americans have nothing saved at all for their golden years, and a third of Americans have less than $5,000. To put that into perspective, it means that 31 percent of U.S. adults could last only a few months on their savings if they had to retire tomorrow.

In order to be comfortable in retirement, financial services company Fidelity recommends putting away 15 percent of your income per year starting at age 25 and investing more than 50 percent of your savings over your lifetime. But to see if you're on track, or even ahead of the game, it's crucial to know your savings rate.

On their blog Money Sloths, Mike and Sophie, who use only their first names online and save up to 80 percent of their annual income, previously broke down how to calculate your personal savings rate, which is the percentage of your disposable income that you put away for the future.

A 36-year-old who learned to invest like Warren Buffett explains how saving can actually cost you money

The formula is simple. "It's just your income, less your spending, divided by your income. Multiply by 100," the Money Sloths write.

They break it down into four steps:

  1. Calculate your income for a specific period
  2. Calculate your spending for the same period
  3. Subtract your spending from your income to figure how much you're saving, then divide this number by your income
  4. Multiply by 100

When calculating your saving rate, it's important to note that it should include your income after taxes, because you'll over-estimate your savings otherwise. Besides, "it's much easier to look at everything from an after-tax basis right now, since your future hypothetical self will face the uncertainty of different tax rates — whether it's because you live in a different state or maybe you're retired and now sit in a lower tax bracket," say Mike and Sophie.

You should also include any employer 401(k) matches in this number since those will go toward your eventual retirement as well.

On the spending side, be sure to include medical expenses such as health insurance, if those don't come straight out of your paycheck, as well as property taxes and interest on any outstanding debt, including your mortgage.

Once you figure out your savings rate, you can get a sense of how close you are to financial independence. This varies according to your personal goals, but experts typically recommend having $1 million set aside to retire in your 60s.

A New York City-based millennial who retired with $2.25 million says this is the key to saving

However, if you want to kick back earlier, many early retirees rely on the "4 percent rule." The idea behind that is, if you can safely withdraw 4 percent a year from your retirement savings portfolio, you have enough in the bank to quit your job.

Flipping the 4 percent rule can help you figure out how big your portfolio needs to be, or what's called your "magic number." Simply divide your annual spending by 0.04 (or multiple it by 25) to get your target.

For example, financial blogger "The Money Wizard" — a Minneapolis-based millennial who goes by the pen name Sean and is on track to retire by age 37 — plans to live off of about $30,000 per year. Using the 4 percent rule, he estimates he'll need $750,000 ($30,000 / 0.04) in the bank to retire comfortably.

Although the 4 percent rule will give you a good idea of how close you are to being able to fund your retirement in full, it's not foolproof. Some experts recommend using a lower withdrawal rate to be safe.

And if you're vying to join the early retirees' club but aren't on track to make it happen yet, take some inspiration from people who have already done it:

This is an updated version of a previously published article.

Don't miss: The top 10 US cities where you can earn $100,000 and still feel broke

Like this story? Subscribe to CNBC Make It on YouTube!

This couple retired in their 30s and travels full-time in an Airstream trailer