California is a state in the Western United States, located along the Pacific Coast. With nearly 39.2 million residents across a total area of approximately 163,696 square miles , it is the most populous U.S. state and the third-largest by area. It is also the most populated subnational entity in North America and the 34th most populous in the world. The Greater Los Angeles and San Francisco Bay areas are the nation's second and fifth most populous urban regions respectively, with the former having more than 18.7 million residents and the latter having over 9.6 million. Sacramento is the state's capital, while Los Angeles is the most populous city in the state and the second most populous city in the country. San Francisco is the second most densely populated major city in the country. Los Angeles County is the country's most populous, while San Bernardino County is the largest county by area in the country. California borders Oregon to the north, Nevada and Arizona to the east, the Mexican state of Baja California to the south; and it has a coastline along the Pacific Ocean to the west.