Should you rent or buy? The cost of owning a home can be steep, but renters often feel as if they are throwing money away. New homeowners could always console themselves with the fact they would probably be paying more in rent if they had stayed in their old apartment. 

While buying is still cheaper in many cities in the middle of the country, the cost of buying a home or condo in the major metropolises on the coasts has risen to the point where renting now looks much more reasonable than before, according to reports by ATTOM Data Solutions and the Urban Institute.

Read High Home Prices Make Renting a Better Choice in These Cities.

Buying a home may be a better deal over the long run. But in the short-term it is now costing more to buy a house than rent an apartment in a growing number of cities, including Seattle, San Francisco, Los Angeles, and Portland. The culprit is a surge in home prices that is far outpacing rent increases.

Here are the metro markets where it's cheaper to rent than buy, assuming a 3.5% down payment, followed by the cities where you're better off buying than renting.

The Urban Institute analyzed 33 metro areas, comparing the cost of owning a home, with a 3.5% down payment, vs. the cost of renting a home in the same market.