Should you buy a home or would you be better off renting? With the economy gradually improving, but mortgage rates and home prices still relatively low, it's a question many potential homebuyers are pondering.

There are a lot of things to consider when making this decision, not the least of them being whether the homeowner lifestyle appeals to you - do you want to spend part of every weekend mowing the lawn or doing household repairs, for instance? But the bigger question for most is whether the numbers will add up.

There are several elements to consider here - how long you'll own the home, cost of rent vs. owning, tax implications, building equity and inflation considerations. We'll take a look at them one at a time.

How long will you stay put?

This may be the most important question of all, believe it or not. If you're not going to stay in a home long enough to make it worth your while, there's no point of going to the trouble and expense of buying one in the first place.

As a rule of thumb, you don't want to buy a home unless you'll be staying in a location for at least five years before moving again. Closing costs on a home and mortgage are generally equal to 3-6 percent of the purchase price, so unless you're there long enough build enough equity to offset those costs, you may be better off renting.

At the same time, if rents are unusually high or home prices unusually low in your area, it could be advantageous to buy even if you're only in the home for as little as three years.

You also want to think about how likely it is that your life may take a different direction in the next few years. How secure is your job? Might you take a different job in a few years that would require moving? If you're married, what about your spouse's employment? If you have children, will you need more space in the next few years?

What makes more sense financially?

This is a tricky one to answer. Because there are a lot of factors involved, and not all of them are predictable.

The easiest way to determine if owning a home is a better deal financially than renting is to look at the price-to-rent ratio for the area where you live or are thinking of buying a home. This means comparing the price of a home you'd like to buy with what it would cost to rent a similar home in the same area for one year.

So if the home sells for $200,000, and a similar property rents for $1,000 a month ($12,000 a year), the price-to-rent ratio is $200,000-to-$12,000, or about 17-to-1. Generally speaking, if the ratio is 20 or higher, it's a much better deal to rent; if it's 15 or lower, it's much better to buy. This is right in the middle.

That leaves a lot of wiggle room, largely because there are a lot of factors it doesn't take into account. Take property taxes, for example. If you're in an area with high property taxes, you need a lower ratio (higher rents) to make buying a home worthwhile, because your overall home ownership costs will be higher.

Crunching the numbers

A more precise method is to tally up your annual costs for renting vs. buying a home, then compare. Since the annual costs of buying usually exceed those of renting, you also want to estimate how quickly you'd build equity by owning a home, and how soon your accumulated equity would offset the lower cost of renting.

To do this, you first add up your estimated annual costs of home ownership: mortgage payments, homeowners insurance, private mortgage insurance (if required), property taxes and maintenance. If you don't have exact figures, insurance and property taxes are usually about one-quarter to one-third of the mortgage payment itself (assuming a 30-year loan). A good estimate for annual maintenance costs is 1 percent of the home price.

You also want to include the cost of any utilities that would be covered in renting a comparable property - some rentals may include things like trash fees and water and sewage charges, for example, which you'd have to pay for if you owned the home.

About the mortgage interest deduction

From this total - which should represent your total cost of owning a home for one year - you want to deduct any tax savings you might realize from the mortgage interest deduction. A word of warning, though - this is often much less than you'd expect.

To take the mortgage interest deduction, you need to pay enough in mortgage interest so that your total itemized deductions exceed your standard deduction - which for 2013 is $12,200 for a couple filing jointly, $6,100 for a single filer. That's a lot of mortgage interest.

Your tax savings are only based on the amount by which your itemized deductions exceed your standard deduction. So if you're a single filer with $8,000 in mortgage interest and other itemized deductions, you're only gaining $2,900 in additional deductions on top of what the standard deduction would give you. If you're in the 25 percent tax bracket, that's a savings of only $725 a year.

Higher-income homebuyers are more likely to benefit from the mortgage interest deduction, because they tend to spend more on their homes and thereby pay more mortgage interest, making it more advantageous to take the deduction. They also pay higher marginal tax rates, so they get more back for every dollar of deductions they take. But many lower-income borrowers like the fact the mortgage deduction allows them to itemize in the first place and take deductions for other expenses as well.

The long-term view

But's let's assume your estimated annual costs for the example above is about $17,000 a year, including any tax savings. That's $5,000 more than the cost of renting. That sounds pretty steep, right? You might wonder why would anyone buy a home if the annual cost is that much more?

The answer is that you also have to take into account that you can accumulate equity in a home, which eventually offsets the higher cost of ownership. If you've got $25,000 in home equity at the end of five years, the difference between owning and renting is pretty much a wash (there are also transaction costs in buying and selling to think about, but we'll get to those in a moment).

There are two ways to build equity: paying down your mortgage and home value appreciation. The first is predictable: if you start out with a $200,000 30-year mortgage at 4.75 percent today, in five years you'll have paid the balance down by about $17,000. In 10 years, that will be about $39,000 - which, excluding another drop in home values, will be converted to equity.

Historically, home values appreciate at an average of about 4 percent a year. While there can be downturns, as recent history showed, there can also be significant spikes as well - most surveys showed U.S. home values with double-digit gains in 2013. A consistent 4 percent annual increase would raise the price of a $200,000 home to about $243,000 in five years. Even a weak 1 percent annual gain would boost the value to $210,000 - which combined with $17,000 in paid-off mortgage debt would provide $27,000 in equity - more than the $25,000 one would save by renting over five years in the example above.

Remember too, that rental rates are subject to inflation, while the monthly payments on most mortgages are fixed (though taxes and insurance may rise). Rent inflation has ranged from about 2 percent to 4.5 percent each year over the past two decades, according to the New York Federal Reserve, with increases in recent years toward the higher end of that range. A 3 percent annual rise in rents over 5 years will increase a $12,000 annual rent bill to about $14,000, further reducing any advantage that renting might have.

What feels right to you?

This is why buying a home tends to be more financially advantageous if you're going to be there for five or more years. You do need to take into account the transaction costs of buying and selling a home, which can take a bite of about 3-6 percent at each end of the process and are one of the main reasons that short-term homeowership is financially unattractive.

Overall, whether to buy vs. renting comes down to two things: how long you plan to stay in the home and how confident you are in the stability of the housing market. The longer you stay put in any location, the greater the financial advantage of home ownership, historically speaking. But it still comes down to what you are comfortable doing.

Published on January 13, 2014