Shanghai is one of the four direct-controlled municipalities of China and the most populous city proper in the world with a population of more than 24 million as of 2014. It is a global financial centre and transport hub, with the world's busiest container port. Located in the Yangtze River Delta, it sits on the south edge of the estuary of the Yangtze in the middle portion of the East China coast. The municipality borders the provinces of Jiangsu and Zhejiang to the north, south and west, and is bounded to the east by the East China Sea.
As a major administrative, shipping and trading city, Shanghai grew in importance in the 19th century due to trade and recognition of its favourable port location and economic potential. The city was one of five treaty ports forced open to foreign trade following the British victory over China in the First Opium War. The subsequent 1842 Treaty of Nanking and 1844 Treaty of Whampoa allowed the establishment of the Shanghai International Settlement and the French Concession. The city then flourished as a centre of commerce between China and other parts of the world (predominantly Western countries), and became the primary financial hub of the Asia-Pacific region in the 1930s. However, with the Communist Party takeover of the mainland in 1949, trade was limited to other socialist countries, and the city's global influence declined. In the 1990s, the economic reforms introduced by Deng Xiaoping resulted in an intense re-development of the city, aiding the return of finance and foreign investment to the city.
During the 1950s and 1960s, Shanghai became the center for radical leftism since it was the industrial centre of China with most skilled industrial workers. The radical leftist Jiang Qing and her three cohorts, together the Gang of Four, were based in the city. Yet, even during the most tumultuous times of the Cultural Revolution, Shanghai was able to maintain high economic productivity and relative social stability. During most of the history of the PRC, Shanghai has been a comparatively heavy contributor of tax revenue to the central government, with Shanghai in 1983 contributing more in tax revenue to the central government than Shanghai had received in investment in the prior 33 years combined. This came at the cost of severely crippling welfare of Shanghainese people and Shanghai's infrastructural and capital development. Its importance to the fiscal well-being of the central government also denied it economic liberalizations begun in 1978. Shanghai was finally permitted to initiate economic reforms in 1991, starting the massive development still seen today and the birth of Lujiazui in Pudong.
Shanghai lies on China's east coast roughly equidistant from Beijing and Guangzhou. The Old City and modern downtown Shanghai are now located in the center of an expanding peninsula between the Yangtze River Delta to the north and Hangzhou Bay to the south, formed by the Yangtze's natural deposition and by modern land reclamation projects. The provincial-level Municipality of Shanghai administers both the eastern area of this peninsula and many of its surrounding islands. It is bordered on the north and west by Jiangsu, on the south by Zhejiang, and on the east by the East China Sea. Its northernmost point is on Chongming Island, now the second-largest island in mainland China after its expansion during the 20th century. The municipality does not, however, include an exclave of Jiangsu on northern Chongming or the two islands forming Shanghai's Yangshan Port, which are part of Zhejiang's Shengsi County. This deep-water port was made necessary by the increasing size of container ships but also the silting of the Yangtze, which narrows to less than 20 meters (66 ft) as far out as 45 miles (70 km) from Hengsha.
Downtown Shanghai is bisected by the Huangpu River, a man-made tributary of the Yangtze that was created by order of Lord Chunshen during the Warring States period. The historic center of the city was located on the west bank of the Huangpu (Puxi), near the mouth of Suzhou Creek, connecting it with Lake Tai and the Grand Canal. The central financial district Lujiazui has grown up on the east bank of the Huangpu (Pudong). The destruction of local wetlands occasioned by the creation of Pudong International Airport along the peninsula's eastern shore has been somewhat offset by the protection and expansion of the nearby shoals of Jiuduansha as a nature preserve.
Shanghai's location on an alluvial plain means that the vast majority of its 6,340.5 km2 (2,448.1 sq mi) land area is flat, with an average elevation of 4 m (13 ft). Its sandy soil has required its skyscrapers to be built with deep concrete piles to stop them from sinking into the soft ground of the central area. The few hills such as She Shan lie to the southwest and the highest point is the peak of Dajinshan Island in Hangzhou Bay (103 m or 338 ft).The city has many rivers, canals, streams and lakes and is known for its rich water resources as part of the Lake Tai drainage area.
Shanghai has a humid subtropical climate (Köppen Cfa) and experiences four distinct seasons. Winters are chilly and damp, with northwesterly winds from Siberia can cause nighttime temperatures to drop below freezing, although most years there are only one or two days of snowfall. Summers are hot and humid, with an average of 8.7 days exceeding 35 °C (95 °F) annually; occasional downpours or freak thunderstorms can be expected. The city is also susceptible to typhoons in summer and the beginning of autumn, none of which in recent years has caused considerable damage. The most pleasant seasons are spring, although changeable and often rainy, and autumn, which is generally sunny and dry. The city averages 4.2 °C (39.6 °F) in January and 27.9 °C (82.2 °F) in July, for an annual mean of 16.1 °C (61.0 °F). With monthly percent possible sunshine ranging from 34% in March to 54% in August, the city receives 1,895 hours of bright sunshine annually. Extremes since 1951 have ranged from −10.1 °C (14 °F) on 31 January 1977 (unofficial record of −12.1 °C (10 °F) was set on 19 January 1893) to 39.9 °C (104 °F) on 6 and 8 August 2013. A highest record of 40.9 °C (106 °F) was registered in Xujiahui, a downtown station on 21 July 2017.