With rising home prices and high competition, many renters may think it is not worth it to switch over to homeownership. However, it is often better financially to own a home than to rent.

GOBankingRates found that it is more affordable to own a home than renting a single-family home in Massachusetts, despite having one of the highest median home prices in the country. The average monthly rent in Massachusetts is $2,176 while the monthly mortgage payment is $2,053.

The website looked at the cost of renting versus owning a home across the country. By comparing the estimated rent price for homes listed on Zillow and the estimated monthly mortgage payment based on the median list price of homes listed on Zillow, based on a 20 percent down payment and a 30-year fixed-rate loan. The calculation also included insurance and taxes.