A high ranking indicates that a city attracts millennials with an … in the Bay Area, San Francisco hit at No. 4 …

Niche.com, which tracks millennial behaviors and decision-making, has named the best cities for young professionals— and two Silicon Valley cities made the top 25.

Niche.com evaluated 232 U.S, cities with a population of 100,000 residents or more for which a sufficient amount of data, taken largely from the U.S. Census, was available. The final 100 cities were identified by considering factors of concern to millennials such as ease of commuting, the percentage of residents age 25 to 34, the percentage of millennials that moved to the city in the past year, crime, median rent, ethnic diversity, and unemployment. The ranking also values quality of life considerations, such as proximity to bars, coffee shops and restaurants.

A high ranking indicates that a city attracts millennials with an affordable, diverse community and lots of things to do.

Sunnyvale came in at No. 15 and Santa Clara landed at 20. Elsewhere in the Bay Area, San Francisco hit at No. 4 and Berkeley at No. 8.