Here’s the formula bank lenders use to determine how much mortgage you can afford.

Don’t start house hunting until you seriously consider how much you can afford to pay. A little advance planning will save you time and money later, because you won’t bid on unattainable houses or apply for loans that are out of your ballpark.

How Much House Can You Afford?

You may hear an old formula that says you can afford a house worth about three times your total (gross) annual income. Don’t rely on this formula, however — it’s much safer to look at your own budget, figuring out how much you have to spare, and what the monthly payments on your new house will be (not just the mortgage — factor in taxes, insurance, maintenance, and more).

Lenders have traditionally wanted you to make all monthly payments using no more than 28% to 44% of your monthly income. In other words, if your monthly income is $2,000, the lender would want you to pay no more than $880 (.44 x $2,000) toward all your debts.

These traditions are, however, becoming less rigid — now, if you have an excellent credit record, a lender might allow you to go more deeply into debt. But you’ll need to use your own common sense, and make sure you leave yourself some money with which to buy furniture, cope with a job layoff, or simply enjoy life.

For a sneak peak at how much of a mortgage you’ll be able to qualify for, see Nolo’s calculator on qualifying for mortgages.

Check Your Credit History

When reviewing loan applications and making financing decisions, lenders typically request that the credit bureaus reporting your file — Equifax, Experian, or TransUnion — provide your credit risk score (also known as your FICO score). This seemingly mysterious number represents a statistical summary of the information in your credit report, including things like your history of paying bills on time and the level of your outstanding debts.

The higher your credit score, the easier it will be to get a loan. If you routinely pay your bills late, expect a lower score, in which case a lender may either reject your loan application or insist on a very large down payment or high interest rate (to lower its risk).

Because your credit history has such an important effect on the type and amount of mortgage loan you’ll be offered, check your credit report and clean up your file if necessary — before, not after, you apply for a mortgage.

Loan Preapproval vs. Loan Prequalification

Once you’ve done the basic calculations and completed a financial statement, you can ask a lender or loan broker for a prequalification letter saying that loan approval for a specified amount is likely based on your income and credit history. Prequalifying lets you determine exactly how much you’ll be able to borrow and how much you’ll need for a down payment and closing costs.

Unless you’re in a very slow real estate market however, with lots more sellers than buyers, you will want to do more than prequalify for a loan: You will want to be preapproved — that is, guaranteed — for a specific loan amount. This means a lender has already checked your credit and evaluated your financial situation, rather than simply relied on your own statements. Preapproval means that the lender would actually fund the loan, pending an appraisal of the property, title report, and purchase contract.

For more information on deciding how much of a loan you can safely take on and successfully qualifying for the loan, see Nolo’s Essential Guide to Buying Your First Home, by Ilona Bray, Alayna Schroeder, and Marcia Stewart.