San Francisco is in the United States.
San Francisco . With a density of about 18,581 people per square mile ( 7,174 people per km2 ) , San Francisco is the most densely settled large city ( population greater than 200,000 ) in California and the second-most densely populated major city in the United States after New York City . United States . The capital is Washington , D.C. , and the largest city is New York City ; nine other major metropolitan areas -- each with at least 4.5 million inhabitants and the largest having more than 13 million people -- are Los Angeles , Chicago , Dallas , Houston , Philadelphia , Miami , Atlanta , Boston , and San Francisco .