The Definitive Guide to Buying Your First Home

How long you have to save to afford a 10% down payment on a home

56731953
Andrew Hetherington | Getty Images

Buying a home will likely be the biggest purchase of your life. And, as with all major savings goals, the sooner you start setting aside money, the easier it will be.

To give you an idea of just how far in advance you should plan before buying your first home, personal finance site NerdWallet determined how long you'd have to save to afford a moderately priced home with a 10 percent down payment, based on average earnings and spending habits for three different age groups.

The average income and spending comes from the Bureau of Labor Statistics (BLS). The chart assumes a 10 percent down payment on a $322,300 mortgage and assumes all available savings go towards the down payment.

Scroll over the chart to see the exact numbers.

"It takes the 45-54 age group longer to save than the 35-44 age group because they spend more each year on everything from food to utilities to property taxes," NerdWallet's mortgage expert Tim Manni tells CNBC Make It. "There are two big-ticket items that have the biggest impact on their ability to save: healthcare and education. The 45-54 age group is spending far more each year on health insurance and prescription drugs, as well as facing a savings headwind thanks to the cost of higher education."

At the end of the day, everyone's situation is different, and, depending on the home you're considering and your other savings goals, it may take more or less time to save for a down payment.

Also keep in mind that some experts recommend putting 20 percent down. A larger down payment will qualify you for lower mortgage rates and will lower your monthly payment. How much you decide to put down will also affect how long you'll have to save for.

Still, these numbers show the importance of planning ahead when it comes to such a significant purchase.

When you're ready to buy, plug your numbers into a mortgage calculator to get a better idea of how much your down payment will cost and what your monthly payments will look like. And don't forget to factor in surprise expenses that come with buying a home, such as maintenance, any renovations you might want to make and moving costs.

Next, read up on eight things to give up if you want to buy your first home and start saving for your goal.

Like this story? Like CNBC Make It on Facebook!

Don't miss: 8 steps to take before buying your first home