Money

Here's how long it takes to break even when you buy a house in 11 major US cities

The Painted Ladies in San Francisco.
Marvin Manabat | Getty Images
The Painted Ladies in San Francisco.

If you're planning to make the jump from renting to buying a home in New York City, you might have to live there for more than 18 years to make it worth the price. But if you decide to buy in Atlanta, you'd probably only have to stay for 4.1 years.

Since buying is more expensive than renting in every state and the District of Columbia, financial planning site SmartAsset did the math to figure exactly how long you'd need to live in a house to break even on the purchase price, versus renting a place in the same city.

For its calculations, SmartAsset compared the total costs of buying and renting a typical home in major cities across the U.S. in 2015 for a household earning $100,000 a year, assuming a 4.5% mortgage rate, $2,000 in closing costs and a 20% down payment.

SmartAsset doesn't take differences in appreciation into account; depending on the neighborhood, you may find that your NYC apartment goes up in value quickly enough that you could sell after far fewer years than the site predicts.

But based on the numbers, here's how long you'd need to stay in your house for buying to make sense in 11 major U.S. cities, ranked from the shortest to the longest amount of time:

Philadelphia

Number of years to break even: 2.9
Average monthly mortgage payment: $432
Average monthly rent: $1,414
Average home price: $157,802

Sunset from City Hall in Philadelphia.
Joe Daniel Price | Getty Images
Sunset from City Hall in Philadelphia.

Atlanta

Number of years to break even: 4.1
Average monthly mortgage payment: $823
Average monthly rent: $1,263
Average home price: $202,969

Atlanta reflected in the lake of Piedmont Park.
Giorgio Fochesato | Getty Images
Atlanta reflected in the lake of Piedmont Park.

Houston

Number of years to break even: 4.2
Average monthly mortgage payment: $645
Average monthly rent: $1,264
Average home price: $159,203

A Houston METRORail light rail train in Downtown Houston.
Davel5957 | Getty Images
A Houston METRORail light rail train in Downtown Houston.

Chicago

Number of years to break even: 4.2
Average monthly mortgage payment: $719
Average monthly rent: $1,331
Average home price: $177,481

Downtown Chicago.
Shobeir Ansari | Getty Images
Downtown Chicago.

Denver

Number of years to break even: 5.4
Average monthly mortgage payment: $1,114
Average monthly rent: $1,504
Average home price: $274,835

Sunset over downtown Denver.
Bridget Calip | Getty Images
Sunset over downtown Denver.

Washington, DC

Number of years to break even: 6.5
Average monthly mortgage payment: $1,909
Average monthly rent: $2,127
Average home price: $471,071

United States Capitol in Washington, DC.
Salvatore Liguigli | Eyeem | Getty Images
United States Capitol in Washington, DC.

Portland, Oregon

Number of years to break even: 6.9
Average monthly mortgage payment: $1,285
Average monthly rent: $1,428
Average home price: $317,085

Downtown Portland, Oregon.
David Gn Photography | Getty Images
Downtown Portland, Oregon.

Los Angeles

Number of years to break even: 8.8
Average monthly mortgage payment: $2,110
Average monthly rent: $2,061
Average home price: $520,559

Downtown Los Angeles at sunset.
Jean-Pierre Lescourret | Getty Images
Downtown Los Angeles at sunset.

San Francisco

Number of years to break even: 14.6
Average monthly mortgage payment: $3,643
Average monthly rent: $2,915
Average home price: $898,706

The Painted Ladies in San Francisco.
Marvin Manabat | Getty Images
The Painted Ladies in San Francisco.

Seattle

Number of years to break even: 14.9
Average monthly mortgage payment: $1,751
Average monthly rent: $1,777
Average home price: $431,939

A view of the Seattle skyline.
Zuraimi | Getty Images
A view of the Seattle skyline.

New York

Number of years to break even: 18.3
Average monthly mortgage payment: $2,399
Average monthly rent: $2,056
Average home price: $591,895

The New York City skyline.
Alexander Spatari | Getty Images
The New York City skyline.