Shanghai is a provincial-level direct-administered municipality in China. It has a population of 29,558,908 in the urban area as of 2025, thus making it China’s most populous city and, more broadly, the fifth-largest city in the world by population. The city is located on the Chinese shoreline on the southern estuary of the Yangtze River, with the Huangpu River bisecting the city.

Shanghai is a global center for finance, business and economics, research, science and technology, manufacturing, transportation, tourism, and culture. The Port of Shanghai is the world's busiest container port. As of 2022, the Greater Shanghai metropolitan area was estimated to produce a gross metropolitan product (nominal) of nearly 13 trillion RMB ($1.9 trillion). The Shanghai Metro, first opened in 1993, is the largest metro network in the world by route length.

Shanghai has been described as a global finance and innovation hub, and it is one of the ten biggest economic hubs in the world. Featuring several architectural styles such as Art Deco and shikumen, the city contains the Lujiazui skyline, and museums and historic buildings such as the City God Temple, Yu Garden, the China Pavilion and buildings along the Bund. Shanghai is known for its cuisine, local language, and cosmopolitan culture. It ranks sixth in the list of cities with the most skyscrapers.

Etymology

The two Chinese characters in the city's name are (/zaon, "upon") and (/hé, "sea"), together meaning "On the Sea". The earliest occurrence of this name is the 11th-century Song dynasty, when there was a river confluence and a town with this name in the area. Others contend that the city is referenced in historical records dating back 2150 years, and that its ancient name, "Hu", suggests it was a fishing village. In 1280 it was renamed "Shanghai", which translates to "Above the Sea". The name's interpretation was disputed, but Chinese historians concluded that during the Tang dynasty, the area of modern-day Shanghai was under sea level, so the land appeared to be "on the sea".

Shanghai is officially abbreviated (/wu) in Chinese, a contraction of (/wu-doq, "Harpoon Ditch"), a 4th- or Jin name for the mouth of Suzhou Creek when it was the main conduit into the ocean. This character appears on motor vehicle license plates issued in the municipality.

Alternative names

(Shēn/sén) or (Shēnchéng/sén-zen, "Shen City") was an early name originating from Lord Chunshen, a 3rd-century BC nobleman and prime minister of the state of Chu, whose fief included modern Shanghai.

(Módū/mó-tu, "monster/fiend/magical city"), is a contemporary nickname for Shanghai. The name was first mentioned in Mato (1924) by Japanese novelist Shōfu Muramatsu. The city has various English nicknames including the "New York of China", in reference to its status as a cosmopolitan megalopolis and financial hub, the "Pearl of the Orient", and the "Paris of the East".

History

Antiquity

The western part of modern-day Shanghai was inhabited 6,000 years ago. During the Spring and Autumn period (approximately 771 to 476 BC), it belonged to the Kingdom of Wu, which was conquered by the Kingdom of Yue, which in turn was conquered by the Kingdom of Chu. During the Warring States period (475 BC), Shanghai was part of the fief of Lord Chunshen of Chu, one of the Four Lords of the Warring States. Local legends claim he ordered the excavation of the Huangpu River, an important river in the area. Its former or poetic name, the Chunshen River, gave Shanghai its nickname of "Shēn".

Imperial era

During the Tang and Song dynasties, Qinglong Town () in modern Qingpu District was a major trading port. Established in 746, it developed into what was historically called a "giant town of the Southeast". The port experienced thriving trade with provinces along the Yangtze and the Chinese coast, as well as foreign countries such as Japan and Silla. By the end of the Song dynasty, the center of trading had moved downstream of the Wusong River to Shanghai. Its status was upgraded from a village to a market town in 1074; in 1172, a second sea wall was built to stabilize the ocean coastline, supplementing an earlier dike. From the Yuan dynasty in 1292 until Shanghai officially became a municipality in 1927, central Shanghai was administered as a county under Songjiang Prefecture, which had its seat in the present-day Songjiang District.

thumb|left|The [[Old City of Shanghai in the 17th century]]

Shanghai's first city wall was built in 1554 to protect the town from raids by Japanese pirates. It was high and in circumference. A City God Temple was built in 1602 during the Wanli reign. This honor was usually reserved for prefectural capitals and not normally given to a county seat like Shanghai. Scholars theorized that this reflected the town's economic importance.

During the Qing dynasty, two central government policy changes caused Shanghai to become one of the most important seaports in the Yangtze Delta region. The first was in 1684, when the Kangxi Emperor reversed the 1525 prohibition on oceangoing vessels. In 1732, the Qianlong Emperor moved the customs office for Jiangsu province (; see Customs House, Shanghai) from Songjiang to Shanghai, and gave Shanghai exclusive control over customs collections for Jiangsu's foreign trade. Shanghai became the major trade port for the lower Yangtze region by 1735, despite being at the lowest administrative level in the political hierarchy.

thumb|right|A map of Shanghai in 1884; Chinese area are in yellow, French in red/pink, British in blue, American in orange.|alt=

In the 19th century, international attention and recognition of its economic and trade potential at the Yangtze grew. British forces occupied the city during the First Opium War. The war ended in 1842 with the Treaty of Nanking, which opened Shanghai as one of the five treaty ports for international trade. The Treaty of the Bogue, the Treaty of Wanghia, and the Treaty of Whampoa, signed between 1843 and 1844, forced Chinese concession to European and American desires for visitation and trade in China. Britain, France, and the United States established a presence outside the walled city of Shanghai, which remained under the direct administration of the Chinese.

The Chinese-held Old City of Shanghai fell to rebels from the Small Swords Society in 1853, but was regained by the Qing government in February 1855. In 1854, the Shanghai Municipal Council was created to manage the foreign settlements. Between 1860 and 1862, the Taiping rebels twice attacked Shanghai and destroyed the city's eastern and southern suburbs, but failed to take the city. In 1863, the British settlement south of Suzhou Creek (northern Huangpu District) and the American settlement to the north (southern Hongkou District) joined to form the Shanghai International Settlement. The French opted out of the Shanghai Municipal Council and maintained its own concession at the city's south and southwest. The First Sino-Japanese War concluded with the 1895 Treaty of Shimonoseki, which elevated Japan as another foreign power in Shanghai. Japan built the first factories in Shanghai, which were copied by other foreign powers. This international activity gave Shanghai the nickname "the Great Athens of China".

Republic era

thumb|[[The Bund as seen from the French Concession in the 1920s]]

In 1912, the Old City walls were dismantled as they blocked the city's expansion. In July 1921, the Chinese Communist Party was founded in the Shanghai French Concession. Workers in the city then launched general strikes against imperialism, which became nationwide protests that gave rise to Chinese nationalism.

thumb|[[Longhua Temple, 1922]]

The golden age of Shanghai began with its elevation to municipality after it was separated from Jiangsu on 7 July 1927. This new Chinese municipality was , and included the districts of Baoshan, Yangpu, Zhabei, Nanshi, and Pudong. The city became a commercial and financial hub of the Asia-Pacific region in the 1930s. During the ensuing decades, citizens of many countries immigrated to Shanghai; those who stayed for long periods⁠⁠ called themselves "Shanghailanders". In the 1920s and 1930s, almost 20,000 White Russians fled the newly established Soviet Union to reside in Shanghai. These Shanghai Russians constituted the second-largest foreign community. By 1932, Shanghai had become the world's fifth-largest city and home to 70,000 foreigners. In the 1930s, approximately 30,000 Jewish refugees from Europe arrived in the city.

thumb|Shanghai Racecourse, stands and administration, 1927

Japanese invasion

thumb|[[Zhabei District on fire, 1937|alt=]]

On 28 January 1932, Japanese military forces invaded Shanghai. More than 10,000 shops and hundreds of factories and public buildings were destroyed, leaving Zhabei district ruined. About 18,000 civilians were either killed, injured, or declared missing. In 1937, the Battle of Shanghai resulted in the occupation of the Chinese-administered parts of Shanghai outside of the International Settlement and the French Concession. People who stayed in the occupied city experienced hunger, oppression, or death. The foreign concessions were occupied by the Japanese on 8 December 1941 and remained occupied until Japan's surrender in 1945.

Many Jewish people arrived in Shanghai during the Japanese occupation period. A vice-consul for Japan in Lithuania, Chiune Sugihara, issued thousands of visas to Jewish refugees escaping the Holocaust, and the Japanese government transferred many of them to Shanghai by November 1941. Other Jewish refugees traveled from Italy. The refugees from Europe were interned in the Shanghai Ghetto in Hongkou District after the Japanese attack on Pearl Harbor. After the surrender of Japan, the Chinese Army liberated the Ghetto, and most of the Jews left over the next few years.

People's Republic era

On 27 May 1949, the People's Liberation Army took control of Shanghai through the Shanghai Campaign. Under the new People's Republic of China (PRC), Shanghai was one of only three municipalities not merged into neighboring provinces (the others being Beijing and Tianjin). Most foreign firms moved their offices from Shanghai to Hong Kong, as part of a foreign divestment due to the PRC's victory.

thumb|right|upright|[[Nanjing Road, 1967, during the Cultural Revolution]]

After the war, Shanghai's economy was restored. From 1949 to 1952, the city's agricultural and industrial output increased by 51.5% and 94.2%, respectively. During the Cultural Revolution (1966–1976), Shanghai's society was severely damaged. The majority of the workers in the Shanghai branch of the People's Bank of China were Red Guards, and they formed a group called the Anti-Economy Liaison Headquarters within the branch. The Anti-Economy Liaison Headquarters dismantled economic organizations in Shanghai, investigated bank withdrawals, and disrupted regular bank service in the city. That year, the China's central government designated Shanghai as the "Dragon Head" of the reform and opening up. In 2022, Shanghai experienced a large outbreak of COVID-19 cases and the Chinese government locked down the entire city on 5 April. This resulted in widespread food shortages across the city as food-supply chains were severely disrupted. These restrictions were lifted on 1 June.

Geography

thumb|left|The urban area of Shanghai in 2016, along with [[islands of Shanghai|its major islands. From northwest to southeast: Chongming, Changxing, Hengsha, and the Jiuduansha shoals off Pudong. The Yangtze's natural sediment discharge can be seen.]]

Shanghai is located on the Yangtze Estuary of China's east coast, with the Yangtze River to the north, Hangzhou Bay to the south, and the East China Sea to the east. The land is formed by the Yangtze's natural deposition and modern land reclamation projects. It has sandy soil, and skyscrapers have to be built with deep concrete piles to avoid sinking into the soft ground. The provincial-level Municipality of Shanghai administers the estuary and many of its surrounding islands. It borders the provinces of Zhejiang to the south and Jiangsu to the west and north. The municipality's northernmost point is on Chongming Island, the second-largest island in mainland China after its expansion during the 20th century.

Shanghai is located on an alluvial plain and the vast majority of its land area is flat, with an average elevation of . Tidal flat ecosystems exist around the estuary, but they have been reclaimed for agricultural purposes. The city's few hills, such as She Shan, lie to the southwest; its highest point is the peak of Dajinshan Island () in Hangzhou Bay.

Downtown Shanghai is bisected by the Huangpu River, a man-made tributary of the Yangtze created by order of Lord Chunshen during the Warring States period.

Climate

Shanghai has a humid subtropical climate (Köppen: Cfa), with an average annual temperature of for downtown areas and for suburbs. In summer and the beginning of autumn, the city is susceptible to typhoons.

The most pleasant seasons are generally spring, although changeable and often rainy, and autumn, which is usually sunny and dry. With monthly percent possible sunshine ranging from 28% in June to 46% in August, the city receives 1,754 hours of bright sunshine annually. According to China's seasonal division standard, from 2001 to 2025, Shanghai enters spring on 9 March, summer on 15 May, autumn on 5 October, and winter on 4 December. The average temperature for the three weeks from 19 July to 8 August is above . Extremes since 1951 have ranged from on 31 January 1977 (unofficial record of was set on 19 January 1893) to on 21 July 2017 and 13 July 2022 at a weather station in Xujiahui. It also has as the highest ever daily minimum temperature at Xujiahui on 2 August 2024.

In 2025, the average temperature of Xujiahui was 19.4°C, which was 1.9°C higher than the average from 1991 to 2020.