Conn. (WTNH) — Choosing the perfect college is daunting, as you’re not only picking a university of your liking, but also a city to live in over the next few years.

WalletHub compared more than 400 U.S. cities, grouped by city size, and looked at 32 key indicators to determine academic, social, and economic growth potential.

New Haven, which is home to the nationally-recognized Ivy League school Yale University, was ranked among the best midsize college cities, taking the No. 10 spot. It ranked alongside Charleston, South Carolina and Madison, Wisconsin.

The Elm City was also ranked the highest out of all schools for the best quality of higher education, beating Pasadena, California and Cambridge, Massachusetts.

Why is the ranking so high? WalletHub‘s study suggests that New Haven has a high score in terms of academic and economic opportunities. It’s also an ideal city to socialize, allowing students to unwind amid typical college stress.

It fell short of Orlando, however, which took the top spot among the best midsize college cities.

Alongside Yale, New Haven houses Albertus Magnus College, Gateway Community College, University of New Haven, and Southern Connecticut State University.

See how each of the 400 cities across the U.S. ranked here.