I'm going to give you a grossly over-simplified formula that will give you a rough idea. Let's say you pay $1,000 in rent each month and your top income tax rate is 20 percent. Take your rent and divide it by the other 80 percent to determine an affordable monthly housing payment: 1,000 divided by 0.80 equals $1,250. Or, your rent divided by the percentage of your income that remains after taxes = X.
That's about how much you can afford to pay for housing when you own the place. It's not a perfect formula because you're not allowed to deduct your entire mortgage payment from your taxes. Only the interest is deductible. Then again, in the beginning of a mortgage loan, most of your payment does go to interest, so it's a reasonable calculation.
Now remember, that amount has to cover the mortgage itself plus property taxes, homeowner's insurance and homeowner's association fees, if any. You should also set aside money for maintenance because there won't be a landlord to fix things anymore. Keep in mind your utility bills could also be higher if you're buying a bigger place than you rent. (You can find out how much the home's monthly power bills are by calling the power company.)
In order to have access to the cash for your new, higher housing payments, you will need to reduce the amount of income tax that is withheld from your paychecks. Ask a tax accountant how many additional allowances you should claim on your W-4 form.
So that's an idea of what size mortgage you can afford. Now you need to know what size mortgage you're likely to get. During the real estate bubble, who knows what formula -- if any -- lenders were using to determine people's eligibility. But now lenders are back to using an old rule of thumb called the 28 percent and 36 percent rule.
They say that your total monthly housing costs (mortgage, property taxes and homeowner's insurance) should be no more than 28 percent of your gross monthly income. They calculate that your total housing costs plus long term debt (alimony, car loans, student loans, etc.) should be no more than 36 percent of your gross monthly income. The strictest lenders make you meet both these standards and sometimes use even lower percentages.
One final thought: all these formulas and numbers are important but also keep in mind that real estate is different from other investments. If the numbers look pretty good for you to buy but you are still on the fence, remember that it is not just a house, it's a home. A place where you can paint the walls purple if you want. A place where your kids can build forts. A place of your own.