You have to live in New York City more than 18 years to make buying a home worth your money

To rent or to buy? It’s a question that most of us will eventually face, particularly city dwellers. If you’re a New York City resident, where the median sales price for homes is $1.2 million, the answer may may be simpler than you thought.

“Perhaps the most important factor to consider when making this buy or rent decision is how long you plan to stay in your home,” writes personal finance site SmartAsset in a recent report.

“If you’ll only be in town a year, renting will almost always be your obvious best choice … You probably don’t want to spend the time and money necessary to buy a house: think down payment, closing costs, loan charges, appraisal fees and so on.”

Of course, everyone’s situation is unique, and there is no clear answer to the age-old “to rent or buy” question.

Sign Up for the undefined Newsletter

However, to help you decide, SmartAsset calculated the breakeven point — the point at which the total costs of renting become greater than the total costs of buying — for 29 major cities.

For New York City, the typical household would have to stay put for 18.3 years to make buying a home worth their money.

To calculate the breakeven points, SmartAsset compared the total costs of buying and renting for a household earning $100,000 a year, drawing data from the US Department of Housing and Urban Development and the US Census Bureau 2012 American Community Survey. For the buying scenario, the research team assumed a mortgage rate of 4.5%, closing costs of $2,000, and a down payment of 20%.

Read the full methodology.

Thanks to New York City’s competitive housing market — which means higher prices, fees, and closing costs — you may want to stick to renting unless you plan on being in the Big Apple for the long haul.