Buying a home is typically the largest single purchase a person will make in his or her lifetime. When you are preparing to make a big purchase in real estate, it is important to understand the complexities of what you can afford, what everything will cost, and how to prepare for your purchase.

Your down payment is a one-time cash payment you provide at the closing. The size of this payment has a long-term effect on your finances, as it determines your monthly mortgage payment and your initial home equity.

If you’re still on the fence about whether to rent or buy, consider your timeline. One widely accepted rule of thumb is that you must own the home for at least five to seven years to reconcile the closing costs and transactions fees paid. However, that period depends on where you live and other costs—this calculator on renting versus buying and can provide more insight for your decision.

To sweeten the deal, sellers can also agree to pay for a portion of, if not all of your closing costs to help shorten the timeframe to make up for the portion of costs you’re required to pay, if any.

Calculate What You Can Afford

Before you start looking at homes, your first step is deciding what you can afford and what you want from a home. List your basic requirements such as location, size, and other features (for e.g., school district).

When it comes to affordability, calculate what your monthly payment will be for the mortgage plus any homeowners association (HOA) fees, taxes, insurance, utilities, maintenance, and other bills.

If you’re one half of a dual-income couple, consider finding a home where you can cover all the expenses on one paycheck. If you need help figuring out what you can afford, try a home calculator like this one from Bankrate.

From there, you can look on a site like Zillow or find an agent you trust to help you price home options in your real estate market. The cost of a house can range from less than $100,000 to many millions, and what you can afford is based on your income and savings.

The median home price in the first quarter of 2015 in the United States ranged from $252,000 in the Northeast to $294,000 in the West, with a national median selling price of $208,000, according to the National Association of Realtors.

first down payment

In general, it is a best practice to put down 20% or more when buying a home. At 20% down, you will have an easier time getting approved for a mortgage and will be able to avoid Private Mortgage Insurance (PMI), which is an additional monthly cost for low-equity home owners. PMI can cost hundreds of dollars per month, so it is in your best interest to avoid it.

If you don’t have a 20% down payment, you can still buy a house with a lower down payment but you’ll just have to pay monthly PMI. Many lenders and states offer loan programs geared toward first-time, low-income homeowners through the Federal Housing Administration (FHA) loan program, or military families through the U.S. Department of Veterans Affairs (VA) loan program.

Some lenders and banks also offer loans requiring less down payment, but you will need to check with them to see if that is an option for you.

The more you put down, the more likely you will be able to negotiate for the lowest possible mortgage rate.

A higher down payment will lower your monthly mortgage payment, and there is no rule against putting down more than 20%. In fact, the more you put down, the more likely you will be able to negotiate for the lowest possible mortgage rate. Remember, you can also deduct mortgage interest payments on your income tax returns.

If you are buying a $220,000 house with 20% down, your down payment will be $44,000.

That is a big cash expense to pay all at once, so start saving as early as possible.

Automate a Savings Plan

Once you know how much you can afford to spend on your home purchase, it is time to start saving. The best option for most people is to save a portion of their paycheck automatically.

You can choose a fixed amount or percentage of each paycheck to get directly deposited from either your paycheck or from your checking account into an appropriate account, such as a cash savings account or Betterment House goal. Save as much as you can so you can quickly build up your balance and make your purchase as soon as you are ready.

Investing to achieve your savings goal can help you reach your goal faster than a cash savings account because you can usually expect higher returns from investing.

For example, if you’re starting at zero and planning to buy a house using a $44,000 down payment, you could save $675 per month in a money market account, Federal Deposit Insurance Corporation (FDIC) insured, that might pay 0.29% annually. And you could save your down payment in five years. By then, your needs—and the housing market and mortgage rates—will likely have changed. A Betterment House goal might help you achieve home ownership faster with a return that’s historically been higher than a savings account.¹

In addition to your automatic savings, do not forget to save any one-time income—which can further speed up your purchasing timeline. If you get an annual bonus, tax refund, large gift, or side income earnings, save as much as possible to build up your savings even faster.

IRA for a First Home Purchase

The IRS allows a little-known tax benefit for first-time home purchases through your IRA account, although the IRS exemption guidelines for a traditional IRA and a Roth IRA are slightly different. The maximum for a one-time, penalty-free distribution per person is $10,000 for a first-time home purchase or for building a home.

If you take the distribution from a traditional IRA, you will have to pay income tax on the money; distributions from a Roth IRA are tax-free (as this investment was originally made with post-tax dollars). With the Roth IRA, the investment account must be at least five years old before it can be tapped for this qualified distribution.

You should always consider any withdrawal from an IRA very carefully and you should discuss any withdrawals with your tax professional. There can be a real opportunity cost to not having that money working to build your liquid retirement wealth.

Building Your Equity

After you have scrimped and saved and made your first home purchase, congratulations—not only are you a homeowner, you are also building equity in your home.

As you pay your mortgage, each month you own more of the property. Over time, your property value may also increase, which adds to your equity as well. If and when you sell your first home, chances are your next down payment will be larger than the sum you started with. It’s just one way to build your wealth.

¹The Betterment portfolio historical performance numbers are based on a backtest of the ETFs or indices tracked by each asset class in a Betterment IRA portfolio. All percentage returns include the Betterment fee (0.15% for $100,000 or more) and the expenses of the underlying ETFs. All values are nominal. More on these calculations can be found here.

More from Betterment: