Experts often recommend saving up $1 million before you retire. But what does it really take to achieve that goal?

CNBC calculated how much you need to put into your 401(k) each month in order to reach $1 million by age 65, depending on when you start saving. Most financial planners suggest you save anywhere between 10 and 15% of your gross salary, so CNBC also calculated the salary you'd need to earn in order to save $1 million without putting away more than 15% of your income.

It's worth noting that 401(k) plans come with contribution limits: In 2019, you can put up to $19,000 in your account, up from $18,500 in 2018. We looked at different rates of return on your investment, but it's impossible to predict future market returns — investing in your 401(k) is a long-term plan, and you should expect to weather some ups and downs in the market. These calculations don't take into account the many ups and downs people experience over their lives, including pay increases, periods of unemployment and sudden financial windfalls or losses. Still it's helpful to get even the most basic sense of what you should be saving to enjoy a seven-figure retirement.

Investing your savings is powerful thanks to compound interest, which is when any interest earned then accrues interest on itself. The earlier you're able to start socking money away, the bigger the boost the stock market will give you. If you start at 25, you could potentially hit a million by 65 by saving around $250 every month for 40 years, which is around $8 a day.

Here's how much you need to save each month to hit seven figures by the time you retire.