This story was originally published in Builder.

Iowa and South Dakota are the best states to live on a middle-class income, according to a new study out Tuesday from personal finance website GOBankingRates.

Hawaii, Massachusetts and California are the worst states for middle-class families due to high costs of home ownership and costs of living.

Hawaii, Massachusetts and California are the worst states for middle-income households based on higher education, income and housing trends.

To identify the best and worst states for middle-class families, GOBankingRates analyzed income, higher education and housing trends in each state. The study is based on the Pew Research Center's definition of "middle-income households" as those with an income that is two-thirds to double the U.S. median household income.

Top 5 States:

Iowa
Median household income:* $75,953
In-state tuition and fees: $8,270
Monthly mortgage payment: $787

South Dakota
Median household income: $77,176
In-state tuition and fees: $8,140
Monthly mortgage payment: $981

West Virginia
Median household income:* $70,838
In-state tuition and fees: $7,490
Monthly mortgage payment: $718

Nebraska
Median household income:* $74,432
In-state tuition and fees: $7,880
Monthly mortgage payment: $903

North Dakota
Median household income:* $75,801
In-state tuition and fees: $7,880
Monthly mortgage payment: $817

Top 5 Worst States:

Hawaii
Median household income:* $74,529
In-state tuition and fees: $10,670
Monthly mortgage payment: $2,594

Massachusetts
Median household income:* $77,965
In-state tuition and fees: $12,280
Monthly mortgage payment: $1,782

California
Median household income:* $73,197
In-state tuition and fees: $9,350
Monthly mortgage payment: $2,155

New York
Median household income:* $73,227
In-state tuition and fees: $7,710
Monthly mortgage payment: $1,503

New Jersey
Median household income:* $75,768
In-state tuition and fees: $13,560
Monthly mortgage payment: $1,319

*Median household income of middle-class families.

Additional findings include:

  • West Virginia saw the highest percent increase in the proportion of households earning middle-class incomes. Only three other states saw an increase in this proportion: Mississippi, Oklahoma and South Dakota.
  • Massachusetts has the highest college graduation rate in the country and an above-average median household income for the middle class. The state also has a middle class that is shrinking faster than any state on the list.
  • South Dakota and Vermont were the only states on the list where the median household income of middle-class families increased between 1999 and 2014.

See the full list here.

To read more stories like this, visit Builder.