Buying a new home is a big decision. Many people focus on the number of bedrooms or the quality of the kitchen appliances, but new homebuyers shouldn’t let these considerations sway them into buying a home that’s more expensive than what they can comfortably afford.

Yet more people seem to be stretching it. About 20 percent of consumers with new, conventional mortgage loans are spending nearly half their monthly income paying down their debts, including their mortgage, according to CoreLogic, which tracks mortgage data. 

Those high mortgage expenses could be a dangerous sign for many consumers, especially because about 68 percent of Americans believe that now is a good time to buy a home, according to a recent homeownership survey from the National Association of Realtors. That’s because interest rates are rising, the housing market has recovered in many areas of the U.S., and banks are eager to lend to prospective homebuyers.

More on Home Ownership

But with more Americans qualifying for mortgages that are larger than they can easily afford, it becomes more difficult to reach other financial goals, such as saving for kids’ college education or your retirement.

Financial planners recommend limiting the amount you spend on housing to 25 percent of your monthly budget. Yet the average married couple with children between ages 6 and 17 spends 32 percent of its budget on housing, and single people spend almost 36 percent, according to the most recent data from the Bureau of Labor Statistics. 

To make sure you don’t spend more than you should, here are some tips for getting an affordable mortgage.

Follow the 25 Percent Rule

There’s a straightforward way to make sure you can afford your mortgage while managing your other goals, according to Eve Kaplan, a certified financial planner based in New Jersey. “Housing—including maintenance—ideally shouldn’t consume more than 25 percent of a household budget. This goes for folks who rent, too,” Kaplan says.

Mortgage bankers would disagree. They use various calculations to figure out how much you can afford, and the amount is often much higher than financial planners recommend. One common measure is the debt-to-income ratio (DTI), which, for a qualified mortgage, limits your total debt payments, including your mortgage, student loans, credit cards, and auto loans, to 43 percent.

Many homebuyers see their home as an investment for the future, which can be an excuse for spending more today than they can easily afford. But real estate can be volatile, as we saw in the 2008 housing crash. Having too much of your net worth tied up in your home can be risky. 

Let’s say you and your spouse make a combined annual income of $90,000, or about $5,600 per month after taxes. Based on your DTI and depending on your other debts, you could be approved for a mortgage of $600,000. That might sound exciting at first, but with a monthly payment of about $3,225, it would eat up more than half your take-home pay. 

Following Kaplan’s 25 percent rule, a more reasonable housing budget would be $1,400 per month. So taking into account homeowners insurance and property taxes, you’d be better off sticking to a mortgage of $240,000 or less. If you have enough for a 20 percent down payment, the maximum house you can afford is $300,000. 

“People think, ‘I’m making really good money. I should be able to afford this,’” says Mary Beth Neeley, a certified financial planner and chief compliance officer at Retirement Strategies, a financial planning firm based in Jacksonville, Fla. “But most people don’t consider saving for the future. You have to put your priorities in place and look at all your goals. You don’t want to have a house that adds stress to your financial situation.”

Neeley asks clients one important question when trying to help them determine what they’re willing and able to spend on housing: “Do you really want to change your lifestyle to have a more expensive home?” 

Aim to Put 20 Percent Down

The amount of mortgage you can afford also depends on the down payment you make when buying a home. “In a perfect world, we recommend a 20 percent down payment to avoid paying mortgage insurance,” Neeley says.

When your down payment is less than 20 percent, your costs rise. You typically have to pay private mortgage insurance, which can cost up to 1 percent of the entire loan amount each year until you build up 20 percent equity in your home. On a $240,000 mortgage, that’s $200 per month. Keep in mind that you will have other ongoing costs related to homeownership as well, from taxes to insurance to utilities. All these expenses need to be estimated before you settle on a monthly mortgage payment.

Consider the 5-Year Rule

Kaplan says homeowners typically need to stay put for at least five years to make the closing costs of buying a home worthwhile. If you are thinking of staying that long, you may be tempted to opt for a mortgage that is higher than you can comfortably afford now. But predicting future income isn’t as easy it may seem. Kaplan cautions that stretching your budget can backfire if you become unemployed for an extended period.

Realize Other Expenses May Come Up

Even if you don’t stretch your budget, an unexpected job loss or other life event could cause you to struggle to make your mortgage payment. The more affordable the home was in the first place, the better chance you’ll have of recovering. Building up an emergency fund is easier if you limit your mortgage payment to 25 percent of your take-home pay. The more cash you have on hand, and the lower your monthly obligations, the better chance you’ll have of staying afloat if difficult times strike.