Middle-class American families struggling to climb the social ladder may have better or worse luck depending on where they live, according to a new study.

"Since the 1970s, the American middle class has been shrinking," GOBankingRates said in a new study that looks at which states offer the best environment for the middle-class.

The personal finance website noted that the Pew Research Center defines middle-class or middle-income households as those with incomes that are two-thirds to double the U.S. medium household income. But according to Pew, the American middle class has been shrinking since the 1970s, when the percentage of middle-class adults in middle-class households decreased from 61% in 1971 to 50% in 2021. And the generational wealth gap between the haves and the have-nots only continues to grow.

Using Pew’s definition of middle class, GOBankingRates analyzed data from the U.S. Census Bureau’s 2019 American Community Survey to determine how much two-, three-, and four-person families need to earn in every state to qualify as middle class. Since middle-class families living in states that take the greatest share of their income struggle to become homeowners or to provide a college education for their children, GOBankingRates also analyzed education and housing as a measurement of class status, as well as income. States that had the highest cost of living in those three areas were the least affordable to be middle class.

Here, in ascending order, are America's top 10 least affordable states to be middle class.

10. Alaska
To be middle class in Alaska, two-person families must earn $57,776 to $172,466; three-person families must earn $62,818 to 187,516; and four-person families must earn $69,727 to $208,140. The state has an 80% high school graduation rate, and in-state college tuition and fees for the 2022-23 school year were $8,987. The median home listing price was $352,479, and the homeownership rate was 66.1%.