San Francisco, officially the City and County of San Francisco, is the fourth-most populous city in California and the 17th-most populous in the United States, with a population of 826,079 in 2025. Some 4.6 million residents live in the city's metropolitan statistical area, which is the 13th-largest in the United States. Around 9.2 million live in the San Jose–San Francisco–Oakland combined statistical area, the fifth-largest in the United States.

Prior to European settlement, San Francisco was inhabited by the Yelamu Ohlone. On June 29, 1776, settlers from New Spain established the Presidio of San Francisco at the Golden Gate, and the Mission San Francisco de Asís a few miles away, both named for Francis of Assisi. The California gold rush of 1849 brought rapid growth, making it the largest city on the West Coast at the time. After three-quarters of the city was destroyed by the 1906 earthquake and fire, In 2024, San Francisco proper had a GDP of $268 billion and a GDP per capita of $324,000. This productivity is spurred by its leading universities, high-tech, healthcare, finance, insurance, real estate, and professional services sectors. The city is home to numerous companies—many in the technology sector—including Salesforce, Uber, Airbnb, Levi's, Gap, OpenAI, Chime, Anthropic, Databricks, Dropbox, and Lyft.

In 2022, San Francisco had more than 1.7 million international visitors and approximately 20 million domestic visitors. It is known for its steep rolling hills and eclectic mix of architecture across varied neighborhoods; its Chinatown and Mission districts; mild climate; and landmarks including the Golden Gate Bridge, cable cars, and Alcatraz. The city is home to educational and cultural institutions such as the University of California, San Francisco, the University of San Francisco, San Francisco State University, the San Francisco Conservatory of Music, the Legion of Honor, the de Young Museum, the San Francisco Museum of Modern Art, the San Francisco Symphony, the San Francisco Ballet, the San Francisco Opera, the SFJAZZ Center, and the California Academy of Sciences. Two major league sports teams, the San Francisco Giants and the Golden State Warriors, play their home games within San Francisco. San Francisco International Airport (SFO) is one of the world's busiest airports, while a light rail and bus network, in tandem with the BART and Caltrain systems, connects nearly every part of San Francisco with the wider region.

Etymology

San Francisco, Spanish for 'Saint Francis', takes its name from Mission San Francisco de Asís, which had been named in honor of Saint Francis of Assisi. The mission received its name in 1776, when it was founded by the Spanish under the leadership of Padre Francisco Palóu. The city has officially been known as San Francisco since 1847, when Washington Allon Bartlett, then serving as the city's alcalde, renamed it from Yerba Buena ('good herb' in Spanish), which had been the name of the first civilian in San Francisco. Earlier in San Francisco's history, the uninhabited area on the northeastern side of San Francisco was called , after the herb that was growing abundantly there. The name Yerba Buena continues to be used in locations in the city, such as on Yerba Buena Island.

When using a nickname or abbreviation, local residents most commonly refer to San Francisco as "the City" or "SF". Although the nickname "Frisco" has a local pedigree dating at least to 1850 and has been used by some local residents in every generation since then, the uses of both "Frisco" and the historically more recent "San Fran" tend to elicit sharp divisions among residents.

The California Cantonese who came for the California Gold Rush named California and specifically San Francisco , , "Gold Mountain".

When gold was discovered in Bendigo, Victoria, Australia, it was named "New Gold Mountain" (, ) and California and San Francisco as "Old Gold Mountain" (, ).

History

Indigenous history

The earliest archeological evidence of human habitation in the area dates to 3000 BCE. The Ohlone name for San Francisco was Ahwaste, meaning "place at the bay". The Yelamu group of the Ramaytush people lived in a few small villages when an overland Spanish exploration party arrived on November 2, 1769, the first documented European visit to San Francisco Bay. The arrival of Spanish colonists, and the establishment of the Mission system, marked the beginning of the assimilation of the Ramaytush people and the decline of their language and culture.

Spanish era (1769–1821)

thumb|left|[[Juan Bautista de Anza established the Presidio of San Francisco for the Spanish Empire in 1776.]]

thumb|left|[[Mission San Francisco de Asís was founded by Padre Francisco Palóu on October 9, 1776.]]

The Spanish Empire claimed San Francisco as part of Las Californias, a province of the Viceroyalty of New Spain. The Spanish first arrived in what is now San Francisco on November 2, 1769, when the Portolá expedition, led by Don Gaspar de Portolá and Juan Crespí, arrived at San Francisco Bay. Having noted the strategic benefits of the area due to its large natural harbor, the Spanish dispatched Pedro Fages in 1770 to find a more direct route to the San Francisco Peninsula from Monterey, which would become part of the El Camino Real route.

In 1774, Juan Bautista de Anza arrived in the area to select sites for a mission and presidio. The first European maritime presence in San Francisco Bay occurred on August 5, 1775, when the Spanish ship San Carlos, commanded by Juan Manuel de Ayala, became the first ship to anchor in the bay.

Soon after, on March 28, 1776, Anza established the Presidio of San Francisco and on October 9, Mission San Francisco de Asís, also known as Mission Dolores, was founded by Padre Francisco Palóu.

Mexican era (1821–1848)

thumb|left|[[Juana Briones de Miranda, known as the "Founding Mother of San Francisco"]]

In 1821, Spain ceded the Californias to Mexico. The extensive California mission system gradually lost its influence during the period of Mexican rule, although it was not until 1833 that the missions would be secularized. Agricultural land became largely privatized as ranchos, as was occurring in other parts of California. Coastal trade increased, including a half-dozen barques from various Atlantic ports which regularly sailed in California waters.

With the enactment of the Mexican Secularization Act of 1833, the missions were required to divest themselves of their extensive landholdings and emancipate the indigenous people under their control. As part of the process of secularization, Governor José Figueroa opened up San Francisco to civilian settlement. Prior to secularization, the only settlements in San Francisco had been the military settlement at the Presidio and the religious settlement at Mission Dolores. Mission Dolores sold most of its property in 1836, retaining only the church and related structures.

thumb|San Francisco in July 1849 Painting by George Henry BurgessIn 1833, Juana Briones de Miranda was granted a small rancho at El Polín Spring, near the Presidio, founding the first non-indigenous civilian household in San Francisco. A land survey of Yerba Buena was made by the Swiss immigrant Jean Jacques Vioget as prelude to the city plan.

Following the Bear Flag Revolt in Sonoma and the beginning of the U.S. Conquest of California, American forces from the USS Portsmouth under the command of John B. Montgomery captured Yerba Buena on July 9, 1846, with little resistance from the local Californio population, raising the American flag over Yerba Buena plaza (later renamed Portsmouth Square in commemoration of this event).

Following the capture, U.S. forces appointed both José de Jesús Noé and Washington Allon Bartlett to serve as co-alcaldes (mayors), while the conquest continued on in the rest of California. On January 30, 1847, Mayor Bartlett ordained that the city should officially change its name from "Yerba Buena" to "San Francisco", as the former name was only locally recognized and the latter name was in use on international maps. There was also concern that a new town being planned by General Vallejo on the Carquinez Strait was to be called "Francisca", after the first name of his wife. After the name change to "San Francisco", the name of Vallejo's town was changed to Benicia, after his wife's middle name. Following the Treaty of Guadalupe Hidalgo in 1848, Alta California was ceded from Mexico to the United States.

Early American era (1848–1906)

thumb|[[Port of San Francisco in 1851]]

Despite its attractive location as a port and naval base, San Francisco under American sovereignty was still a small settlement with inhospitable geography, lacking most of the basic facilities for a proper settlement. Its 1847 population was said to be 459. raising the population from 1,000 in 1848 to 25,000 by December 1849. The promise of wealth was so strong that crews on arriving vessels deserted and rushed off to the gold fields, leaving behind a forest of masts in San Francisco harbor. Some of these approximately 500 abandoned ships were used at times as storeships, saloons, and hotels; many were left to rot, and some were sunk to establish title to the underwater lot. By 1851, the harbor was extended out into the bay by wharves while buildings were erected on piles among the ships. By 1870, Yerba Buena Cove had been filled to create new land. Buried ships are occasionally exposed when foundations are dug for new buildings.

California was quickly granted statehood in 1850, and the U.S. Army built Fort Point at the Golden Gate and a fort on Alcatraz Island to secure the bay. San Francisco County was one of the state's 18 original counties established at California statehood in 1850. San Francisco's city limits originally extended west to Divisadero Street and Castro Street, and south to 20th Street, but in 1856, the California state government divided the county. A straight line was then drawn across the tip of the San Francisco Peninsula just north of San Bruno Mountain. Everything south of the line became the new San Mateo County, while everything north of the line became the new consolidated City and County of San Francisco.

thumb|left|The [[Bank of California, established in 1864, was the first commercial bank in Western United States.]]

In addition to triggering a sharp growth in population, The California gold rush also triggered a wave of entrepreneurial activity as individuals sought to capitalize on the newfound wealth. The discovery of silver deposits, notably the Comstock Lode in Nevada in 1859, further fueled rapid population growth and economic expansion.

The influx of fortune seekers and surge in population also brought challenges, including heightened criminal activity and poverty. Lawlessness became rampant, and the Barbary Coast district became synonymous with vice, attracting criminals, prostitutes, and illicit activities, including but not limited to prostitution, bootlegging, and gambling. The rapidly growing population, with its lawlessness, gambling and other vices, and the fact that there were no churches to be found, prompted missionaries like William Taylor to come to San Francisco where he began preaching in the streets, using an upright barrel as his pulpit. Taylor garnered enough generous donations from successful gold miners to build a church.

One of the most influential figures of this era was William Chapman Ralston. A shrewd banker and investor, Ralston amassed considerable wealth and influence in San Francisco. He gained control over a significant portion of the Comstock Lode's gold and silver mines, establishing a virtual monopoly. Using his incredible clout, Ralston was able to generate millions of dollars for San Francisco during its heady boom years. He founded the Bank of California, the first bank in the Western United States, and built the opulent Palace Hotel, a symbol of San Francisco's newfound prosperity and the largest hotel in the country at the time. His financial empire, however, collapsed in 1875 as a result of the Panic of 1873, triggering a major economic crisis in San Francisco.

thumb|right|Illustration by H.A. Rodgers for [[Frank Leslie's Illustrated Newspaper (March 20, 1880) showing a Workingmen's Party of California anti-Chinese rally on the sand lots near San Francisco City Hall]]

The resulting unemployment and poverty from the Long Depression led to a rise in anti-Chinese sentiment that culminated in the San Francisco riot of 1877, in which a mob of the city's majority Irish population descended on Chinatown, killing four and causing $100,000 worth of property damage. These events gave rise to the Workingmen's Party of California, led by drayman Denis Kearney and mobilized by his slogan "The Chinese must go!" The party elected one third of delegates to California's Second Constitutional Convention (the most of any organized party), This agitation paved the way for the Chinese Exclusion Act of 1882, which prohibited all immigration of Chinese laborers to the United States until it was repealed over 60 years later.

Development of the Port of San Francisco and the establishment in 1869 of overland access to the eastern U.S. rail system via the newly completed Pacific Railroad (the construction of which the city only reluctantly helped support) helped make the Bay Area a center for trade. Catering to the needs and tastes of the growing population, Levi Strauss opened a dry goods business and Domingo Ghirardelli began manufacturing chocolate. Chinese immigrants made the city a polyglot culture, drawn to "Old Gold Mountain", creating the city's Chinatown quarter. By 1880, Chinese made up 9.3% of the population.

thumb|left|A view of the city in 1878

The first cable cars carried San Franciscans up Clay Street in 1873. The city's sea of Victorian houses began to take shape, and civic leaders campaigned for a spacious public park, resulting in plans for Golden Gate Park. San Franciscans built schools, churches, theaters, and all the hallmarks of civic life. The Presidio developed into the most important American military installation on the Pacific coast.

In 1890, San Francisco's population approached 300,000, making it the eighth-largest city in the United States at the time. Around 1901, San Francisco was a major city known for its flamboyant style, stately hotels, ostentatious mansions on Nob Hill, and a thriving arts scene.In addition to the population boom, the first North American plague epidemic was the San Francisco plague of 1900–1904.

Modern American era (1906–1940)

thumb|right|The [[1906 San Francisco earthquake was the deadliest earthquake in U.S. history.]]

At 5:12 am on April 18, 1906, a major earthquake struck San Francisco and northern California. As buildings collapsed from the quake, ruptured gas lines ignited fires that spread across the city and burned out of control for several days. With water mains out of service, the Presidio Artillery Corps attempted to contain the inferno by dynamiting entire city blocks to create firebreaks. After the flames died down, it was estimated that more than three-quarters of the city lay in ruins, including the entire downtown core. Contemporary accounts reported that 498 people died, though modern estimates put the number far higher in the several thousands. More than half of the city's population of 400,000 was left homeless. Refugees settled temporarily in makeshift tent villages throughout the city, including in Golden Gate Park, the Presidio, and on the beaches. Jack London is remembered for having famously eulogized the earthquake: "Not in history has a modern imperial city been so completely destroyed. San Francisco is gone."

Rebuilding was rapid and performed on a grand scale. Rejecting calls to completely remake the street grid, San Franciscans opted for speed. Amadeo Giannini's Bank of Italy, later to become Bank of America, provided loans for many of those whose livelihoods had been devastated. The influential San Francisco Planning and Urban Research Association or SPUR was founded in 1910 to address the quality of housing after the earthquake. The earthquake hastened development of western neighborhoods that survived the fire, including Pacific Heights, where many of the city's wealthy rebuilt their homes. In turn, the destroyed mansions of Nob Hill became grand hotels. City Hall rose again in the Beaux Arts style, and the city celebrated its rebirth at the Panama–Pacific International Exposition in 1915.

thumb|left |upright=1.35|The [[Panama–Pacific International Exposition (1915)|Panama–Pacific Exposition, a major world's fair held in 1915, was seen as a chance to showcase the city's recovery from the earthquake.]]

During this period, San Francisco built some of its most important infrastructure. Civil Engineer Michael O'Shaughnessy was hired by San Francisco Mayor James Rolph as chief engineer for the city in September 1912 to supervise the construction of the Twin Peaks Reservoir, the Stockton Street Tunnel, the Twin Peaks Tunnel, the San Francisco Municipal Railway, the Auxiliary Water Supply System, and new sewers. San Francisco's streetcar system was pushed to completion by O'Shaughnessy between 1915 and 1927. It was the O'Shaughnessy Dam, Hetch Hetchy Reservoir, and Hetch Hetchy Aqueduct that would have the largest effect on San Francisco. An abundant water supply enabled San Francisco to develop into the city it has become today.

thumb|The [[San Francisco–Oakland Bay Bridge|Bay Bridge under construction on Yerba Buena Island in 1935]]

In ensuing years, the city solidified its standing as a financial capital; in the wake of the 1929 stock market crash, not a single San Francisco-based bank failed. It was at the height of the Great Depression that San Francisco undertook two great civil engineering projects, simultaneously constructing the San Francisco–Oakland Bay Bridge and the Golden Gate Bridge, completing them in 1936 and 1937, respectively. It was in this period that the island of Alcatraz, a former military stockade, began its service as a federal maximum security prison, housing notorious inmates such as Al Capone and Robert Franklin Stroud, the Birdman of Alcatraz. San Francisco later celebrated its regained grandeur with a World's fair, the Golden Gate International Exposition in 1939–40, creating Treasure Island in the middle of the bay to house it.

Postmodern American era (1941–present)

thumb|left|The [[United Nations was created in San Francisco in 1945, when the United Nations Charter was signed at the San Francisco Conference.]]

During World War II, Hunters Point Naval Shipyard became a hub of activity, and Fort Mason became the primary port of embarkation for service members shipping out to the Pacific Theater of Operations. the city-owned Sharp Park in Pacifica was also used as an internment camp to detain Japanese Americans. The explosion of jobs drew many people, especially African Americans from the South, to the area. After the end of the war, many military personnel returning from service abroad and civilians who had originally come to work decided to stay. The United Nations Charter creating the United Nations was drafted and signed in San Francisco in 1945 and, in 1951, the Treaty of San Francisco re-established peaceful relations between Japan and the Allied Powers.

Significant urban planning projects in the 1950s and 1960s involved widespread destruction and redevelopment of west-side neighborhoods and the construction of new freeways, of which only a series of short segments were built before being halted by citizen-led opposition. The onset of containerization made San Francisco's small piers obsolete, and cargo activity moved to the larger Port of Oakland. The city began to lose industrial jobs and turned to tourism as the most important segment of its economy. The suburbs experienced rapid growth, and San Francisco underwent significant demographic change, as large segments of the white population left the city, supplanted by an increasing wave of immigration from Asia and Latin America. From 1950 to 1980, the city lost over 10 percent of its population.

thumb|The [[Summer of Love in 1967 was an influential counterculture phenomenon with as many as 100,000 people converging in San Francisco's Haight-Ashbury neighborhood.]]

Over this period, San Francisco became a magnet for America's counterculture movement. Beat Generation writers fueled the San Francisco Renaissance and centered on the North Beach neighborhood in the 1950s. Hippies flocked to Haight-Ashbury in the 1960s, reaching a peak with the 1967 Summer of Love. In 1974, the Zebra murders left at least 16 people dead. In the 1970s, the city became a center of the gay rights movement, with the emergence of The Castro as an urban gay village, the election of Harvey Milk to the Board of Supervisors, and his assassination, along with that of Mayor George Moscone, in 1978.

Bank of America, now based in Charlotte, North Carolina, was founded in San Francisco; the bank completed 555 California Street in 1969. The Transamerica Pyramid was completed in 1972, igniting a wave of "Manhattanization" that lasted until the late 1980s, a period of extensive high-rise development downtown. The 1980s also saw a dramatic increase in the number of homeless people in the city, an issue that remains today, despite many attempts to address it.

thumb|upright|left|The [[Transamerica Pyramid, built in 1972, characterized the Manhattanization of the city's skyline in the 1970–80s.]]

The 1989 Loma Prieta earthquake caused destruction and loss of life throughout the Bay Area. In San Francisco, the quake severely damaged structures in the Marina and South of Market districts and precipitated the demolition of the damaged Embarcadero Freeway and much of the damaged Central Freeway. The reconstruction allowed the city to reclaim The Embarcadero as its historic downtown waterfront and revitalizing the Hayes Valley neighborhood.

The three recent decades have seen booms driven by the internet industry. During the dot-com boom of the late 1990s, startup companies invigorated the San Francisco economy. Large numbers of entrepreneurs and computer application developers moved into the city, followed by marketing, design, and sales professionals, changing the social landscape as once poorer neighborhoods became increasingly gentrified. Demand for new housing and office space ignited a second wave of high-rise development, this time in the South of Market district. By 2000, the city's population reached new highs, surpassing the previous record set in 1950. When the bubble burst in 2001, many of these companies folded and their employees were laid off. Yet high technology and entrepreneurship remain mainstays of the San Francisco economy. By the mid-2000s (decade), the social media boom had begun, with San Francisco becoming a popular location for tech offices and a common place to live for people employed in Silicon Valley companies such as Apple and Google.