San Francisco is also hub of the San Jose-San Francisco-Oakland metropolitan area, which has a population of 8.7 million. San Francisco is the 13th most populous city in the country with a density of 6,266 people per square mile. It's the second most densely populated city in the country after New York City.