A recent view of part of the skyline in Arlington’s Rosslyn area. (Jeffrey MacMillan for The Washington Post)

Arlington has been named the nation’s “Best City for Millennials,” and Alexandria came in fourth, according to a recent ranking. The District wasn’t far behind, at No. 12.

The list, compiled by the website Niche, said the ranking was based on several factors, including the number of job openings, access to bars and restaurants, affordable housing and on the number of millennial residents. The data used to compile the rankings came from the U.S. Census Bureau, the Bureau of Labor Statistics and the FBI.

The full top 10 included:
1. Arlington
2. Cambridge, Mass.
3. San Francisco
4. Alexandria
5. Minneapolis
6. Seattle
7. Ann Arbor, Mich.
8. Berkeley, Calif.
9. Sunnyvale, Calif.
10. Sandy Springs, Ga.

San Antonio, came in last on the list of 100.

The review gave Arlington high marks in categories such as public schools, nightlife, diversity and being good for families. It got a B-minus in housing. (Arlington is actually not a city, it is a county. But with no incorporated towns or cities within its borders, it often is referred to as a city.)

Alexandria also got high marks in most of the same categories as Arlington, but got a C-plus in housing.

In another recent survey, the District ranked as the fourth best place to live in the country, according to U.S. News & World Report.