The location of a school doesn't just affect how much you enjoy your college experience. It also plays a big part in how much you spend to get your degree.

Students in every state carry student loan debt, but loan balances at graduation vary quite a bit from state to state. To determine the worst states for student loan debt, we looked at the average student loan balances of graduates in each state in 2017.

Here are the five states that had the highest balances and why students spent more there.

College students walking in an arched hallway.

Image source: Getty Images

1. Connecticut

Connecticut takes the dubious top spot with an average student loan balance of $38,510. That's about $10,000 higher than the average balance in the United States.

One reason students in Connecticut accumulate so much debt is a lack of state funding that results in higher tuition costs (a recurring theme throughout this list). Per student, the state spent 20% less on higher education funding in 2018 than it did in 2008.

That has made it costly to attend public college there. The College Board reports that among public four-year institutions, schools in Connecticut had the 10th most expensive in-state tuition and the fourth most expensive out-of-state tuition for the 2019–20 school year.

A high cost of living is another factor that drives up student debt. Connecticut ranks fourth by that measure, so students there need to spend more on housing, food, and transportation than students in other states.

2. Pennsylvania

The average balance of student loans in Pennsylvania is $36,854, and once again, tuition is a huge part of that. It's even more expensive than Connecticut in terms of in-state tuition, as public four-year universities in Pennsylvania charged an average of $14,770 in tuition and fees. That's more than schools in all but two other states.

State budget cuts are a prominent reason for the rising tuition costs of schools in Pennsylvania. From 2008 to 2016, state funding per student for public colleges dropped by 33%, a larger decrease than almost any other state.

Not only does Pennsylvania have high average tuition costs, but it's also home to four of the 50 most expensive colleges in the country. 

3. Rhode Island

Although Rhode Island is the smallest state in the U.S. and doesn't have many universities, it does have several expensive schools, including Brown University, Providence College, and the Rhode Island School of Design. The state also cut its higher education funding by 24% from 2008 to 2016. In 2017, students there had an average loan balance of $36,250.

It's not just the cost of going to school that contributes to Rhode Island's student debt problem. The state also has the worst job availability for postgraduates, making it difficult for students to pay off what they borrow.

4. New Hampshire

New Hampshire is another state that doesn't provide much financial support to its schools. Per capita, it spends the least money on higher education of any state.

With little government support, New Hampshire's colleges rely more on tuition costs, so they need to charge students more. The state's public four-year schools average the second-highest tuition and fees in the nation at $16,460, more than $6,000 above the national average.

5. Delaware

Pennsylvania may have had one of the steepest decreases in state funding for higher education from 2008 to 2016, but Delaware wasn't far behind. Its own state support went down by 28.8% during that same period.

That lack of funding has taken a toll on the state's financial aid offerings. From 2016 to 2017, Delaware had to deny need-based, taxpayer-funded scholarships to 67% of eligible students. It's one of 10 states that had to do this for at least half of its eligible financial aid applicants.

Why student loan balances are higher in certain states

When you look at the worst states for student loan debt, there's a common issue that stands out.

Every state on the list made significant cuts to its higher education funding in recent years. That forces public colleges to drive up their tuition costs and deny qualified students state scholarships.

No matter where you go to school, you can make college more affordable by working part-time and keeping your costs down. But, as the student loan balances in these states demonstrate, tuition costs and financial aid opportunities are two of the most important factors in how much your education costs you.