Before you start poring over real estate listings, take time for this reality check: How much house can you afford? Here’s how to figure that out.

Debt-to-income ratio: It’s about what you make—and what you owe

For a quick back-of-the-napkin calculation, try tripling what you (and your partner, if you’re buying together) make in a year. For example, if your income totals $100,000 a year, this means you can afford a home worth $300,000.

“The general rule of thumb is that you can purchase a home that costs about three times your annual salary,” says Harrine Freeman, a financial expert and the owner of H.E. Freeman Enterprises.

Income, however, is only half of the picture; you also have to consider your debts. College loans, car loans, and credit card balances can crimp your ability to pay a mortgage, too.

The way to factor in your income and debts is called your debt-to-income ratio, or DTI. To find this magic number,…