A little math can go a long way.

There is a simple way to get an estimate of how much money you will need to save for retirement.

You figure out how much you spend per year, then work your way backward to see how much money you would need to have invested to live off your savings.

CNBC crunched the numbers, and we can tell you how much you need to save now to safely get $30,000 of passive income every year in retirement.

For investing, we assume an annual 4% return when you are saving. We do not factor in inflation, taxes or any additional income you may get from Social Security and your 401(k).

In retirement, we use the “4% rule,” which is a general principle that says you can comfortably withdraw 4% of your portfolio every year.

It is important to note that with the recent market volatility, there is a risk you’ll have to lower your spending percentage in the future. The numbers also assume you will retire at 45, have no money in savings now and plan to put away a substantial amount of income to reach your goal.

Check out this video to get a full breakdown of the numbers.

**More from Invest in You:**

Retire by 50: How much you need to invest per month to save $3 million

Americans are more in debt than ever and experts say ‘money disorders’ may be to blame

How much money do you need to retire? Start with $1.7 million

*Disclosure: NBCUniversal and Comcast Ventures are investors in **Acorns**.*