Here’s how to save $2 million on a $50,000 salary, broken down by age

For many Americans, saving $2 million for retirement may sound like an impossible goal.

The average worker in America makes just over $50,000. By the time you factor in cost of living, there might not be a ton of money left over for retirement.

Yet if you start investing early enough, retiring with millions of dollars in your nest egg will only take a fraction of your paycheck.

As a rule of thumb, most financial advisors suggest you save 10% to 15% of your salary. But if your goal is to get to $2 million, the percentage you need to invest will vary widely based on how old you are when you start.

NerdWallet crunched the numbers, and we can tell you exactly how much of your $50,000 you’ll need to tuck away to get there.

Just a few things to remember: These numbers assume you have no money in your retirement plan, that you will get a 6% return on your investments and that you will retire at age 65.

The math also does not account for potential pay increases, employer matches, inflation or any curveballs that life may throw at you. So plan accordingly.

Check out this video to dive into the figures.