Berkeley is the fifth-best city to live in America in 2017, according to a recently published ranking by Niche.

On the list, titled “2017 Best Cities to Live in America,” the city ranked just below Ann Arbor, Michigan; Naperville, Illinois; Arlington, Virginia; and Columbia, Maryland. Other cities that also made the top ten include The Woodlands, Texas; Plano, Texas; Overland Park, Kansas; Boulder, Colorado and Irvine, California.

The grading was based on an A-F system for each criterion, with Berkeley scoring A’s in almost every one — public schools, nightlife, good for families, diversity, weather, health and fitness, outdoor activities and commute. The city, however, scored low in housing and crime and safety, with a C in both areas. Cost of living received a D.

Both the percentage of residents that hold graduate degrees or higher and those that hold bachelor’s degrees exceed the national average, according to data shown on Niche’s website. Berkeley experiences twice the number of robberies and motor vehicle thefts than the national average annually.

Niche’s ranking method is complex; it considers various factors such as the education levels of its residents, the consumer price index, home values and the number of students served by the public school system for the overall ranking of its cities.

“This grade takes into account several key factors of a location, including the quality of local schools, crime rates, housing trends, employment statistics, and access to amenities in an attempt to measure the overall quality of an area,” the website’s methodology page states.

Niche says it uses data from places such as the Department of Education, U.S. Census and the FBI, according to its website. In addition to public data sets, Niche analyzes more than 100 million reviews and survey responses.

Berkeley also ranked fourth on Niche’s list of “Healthiest Cities in America” and fifth for “Best Cities for Outdoor Activities in America.”

Berkeley resident Jennifer Rubin, who has now lived in the city for almost a decade, said she likes both the uniqueness and accessibility of the city.

“It’s a nice balance between feeling like you’re outside in the city but you can still walk to everything. I (also) like how all the houses look beautiful and unique,” Rubin said. “I feel proud that it’s number five.”

Christine Lee is an assistant news editor. Contact Christine Lee at [email protected] and follow her on Twitter at @christinejlee17.