To find out whether you should rent or buy a home, crunch the numbers using this two-step process.

The most common question people have about their living situation is whether it’s better to rent or own a home. The answers they get are typically either too generalized mathematically, or cover lifestyle issues while leaving out economic factors. Here are two ways to answer the rent versus buy question.

Step 1: By the numbers

The first method is to understand the basic math of how to compare renting versus buying. There are components to this step:

  1. Calculate the monthly cost of homeownership.
  2. Calculate the tax benefits of homeownership.
  3. Subtract the tax benefits from the cost of ownership to get the “after tax cost.”
  4. Compare the after tax cost to market rent for a comparable property.

Using this approach, let’s calculate the monthly cost of buying a home in Seattle, where the housing market is very hot and the median home price across the region is $478,500.

Suppose you’re buying a home of this price with 20 percent down and a top-tier credit score of 780, with a 30-year fixed mortgage rateof 3.625 percent (remember, rates change daily). A quick run through the mortgage calculator shows that this mortgage payment is $1,746, property taxes are $479, and homeowner’s insurance is $67, for a total monthly housing cost of $2,292.

The federal tax deductions homeowners get for mortgage interest and property taxes save $490 per month in taxes. (To calculate estimated tax savings, multiply loan amount by interest rate and multiply purchase price by property tax rate estimate of 1.2 percent. Add these two numbers, and multiply the result by an income tax rate estimate of 30 percent, then divide by 12 to get a monthly figure. Always consult your tax adviser on any tax-related matters for a precise calculation specific to your situation.)

Subtract the monthly tax savings from total monthly housing cost of $2,291 to get an after-tax housing cost of $1,802. If we compare this to the Seattle median rent of $1,791, we can see that renting is $11 per month cheaper than buying — very close, even in a hot market.

If you do these calculations in other areas such as the Dallas-Fort Worth metro, where home prices are lower and rents are higher (relative to ownership costs), the math will more clearly support buying over renting. In some markets, buying can be cheaper than renting even before incorporating homeowner tax benefits.

Doing these rent-versus-buy calculations for your own market only takes a few minutes. Just look up home prices and rents in your area to get started.

Step 2: Time will tell

The second method for deciding if it’s better to rent or own is to understand how long it takes for buying to become more financially advantageous than renting. The point at which this happens is called the breakeven horizon.

This is a calculation Zillow created to analyze rent-versus-buy decisions at the household level. It incorporates all possible buying costs and benefits such as down payment, closing costs, mortgage payment, property taxes, insurance, utilities, maintenance, and tax benefits, as well as all renting costs for the same home. Calculations also incorporate home value and rental price appreciation.

Breakeven horizon is the year when buying costs become less than or equal to renting costs when accounting for all of the factors noted above.

For our Seattle sample area, the average breakeven horizon is 1.9 years, which (only coincidentally) is the same as the national breakeven horizon right now — meaning buying becomes more financially advantageous than renting after 1.9 years. The latest full list of breakeven horizons for major cities shows how various areas perform on this rent-versus-buy method.

The sample Seattle market calculations above show it costs about the same ($11 difference) to buy or rent right now if you account for tax benefits, and it costs more to buy than rent if you don’t account for tax benefits. If you then consider that buying becomes more financially advantageous than renting 1.9 years after your purchase, these two methods combined make a good case for buying.

Once you’ve analyzed both of these rent-versus-buy methods for your target area, you’ll have a strong command of which option makes the most financial sense. Then the rest of your rent-versus-buy decision is about lifestyle choices like whether of not you want mobility, maintenance responsibility, or freedom to upgrade your living space.