When high school juniors and seniors start shopping for a college, of course they care about the quality of their academic education, and their earning potential.

Let’s hope they’re thinking about costs, too (how much is rent and tuition? How much is a pizza?)

The college town itself is a big factor. College students want a good social environment (are there nightclubs and breweries? Food trucks? Sports? Festivals?)

Not to mention, boomers eye college towns as a terrific potential retirement spot, for many of the same reasons.

To find the best college towns, WalletHub compared and ranked more than 400 U.S. cities of varying sizes based on 31 key indicators of academic, social and economic opportunities for students, including those things mentioned above, as well as cost of living, quality of higher education and crime rate. Click on the gallery below to see 30 of the best college towns in the U.S.