ELMHURST, IL — Elmhurst is among the best small cities in the country, according to WalletHub. The personal finance website recently released the results of a study comparing smaller towns based upon five key dimensions: affordability, economic health, education and health, quality of life and safety.

The findings ranked 1,268 cities with populations between 25,000 and 100,000, with Elmhurst ranking in the 95th percentile. Elmhurst also ranked 159th in terms of affordability, 124th in economic health, 335th for education and health and 80th for safety compared with the other cities on the list. Sevreal Illinois cities ranked higher than Elmhurst on the list including: Highland Park, Algonquin, Northbrook, Plainfield, Wheaton and Glen Ellyn.

The study looked at things like school-system quality, population growth, high school graduation rate, the average commute time, number of attractions and more. Cities were given a certain number of points depending on how well they scored on the five key dimensions. The 99th percentile represents the top 1 percent of small cities in America, according to WalletHub. The top-ranked city with the highest total score was Princeton, New Jersey, while Bessemer, Alabama, which calls itself "The Marvel City," ranked last. Read the full rankings here.