Taiwan, officially the Republic of China (ROC), is a country in East Asia, at the junction of the East and South China Seas in the northwestern Pacific Ocean, with the People's Republic of China (PRC) to the northwest, Japan to the northeast, and the Philippines to the south. The territories controlled by the ROC consist of 168 islands, with a combined area of 36,193 square kilometres (13,974 sq mi). The main island of Taiwan, also known as Formosa, has an area of 35,808 square kilometres (13,826 sq mi), with mountain ranges dominating the eastern two-thirds and plains in the western third, where its highly urbanised population is concentrated. The capital, Taipei, forms along with New Taipei City and Keelung the largest metropolitan area of Taiwan. Other major cities include Kaohsiung, Taichung, Tainan, and Taoyuan. With around 23.9 million inhabitants, Taiwan is among the most densely populated countries in the world.
Taiwan has been settled for at least 25,000 years. Ancestors of Taiwanese indigenous peoples settled the island around 6,000 years ago. In the 17th century, large-scale Han Chinese (specifically Hoklo) immigration to western Taiwan began under a Dutch colony and continued under the Kingdom of Tungning. The island was annexed in 1683 by the Qing dynasty of China, and ceded to the Empire of Japan in 1895. The Republic of China, which had overthrown the Qing in 1911, took control of Taiwan on behalf of the Allies of World War II following the surrender of Japan in 1945. The resumption of the Chinese Civil War resulted in the ROC's loss of mainland China to forces of the Chinese Communist Party (CCP) and consequent retreat to Taiwan in 1949. Its effective jurisdiction has since been limited to Taiwan and smaller islands.
In the early 1960s, Taiwan entered a period of rapid economic growth and industrialisation called the "Taiwan Miracle". In the late 1980s and early 1990s, the ROC transitioned from a one-party military dictatorship to a multi-party democracy with a semi-presidential system. Taiwan's export-oriented industrial economy is the 21st-largest in the world by nominal GDP and 19th-largest by PPP measures, with a focus on steel, machinery, electronics and chemicals manufacturing. Taiwan is a developed country, ranking 20th on GDP per capita. It is ranked highly in terms of civil liberties, healthcare, and human development.The political status of Taiwan is contentious. The ROC no longer represents China as a member of the United Nations, after UN members voted in 1971 to recognize the PRC instead. The ROC maintained its claim of being the sole legitimate representative of China and its territory, although this has been downplayed since its democratization in the 1990s. Taiwan is claimed by the PRC, which refuses diplomatic relations with countries that recognise the ROC. Taiwan maintains official diplomatic relations with 13 out of 193 UN member states and the Holy See, though many others maintain unofficial diplomatic ties through representative offices and institutions that function as de facto embassies and consulates. International organisations in which the PRC participates either refuse to grant membership to Taiwan or allow it to participate only on a non-state basis under various names. Domestically, the major political contention is between parties favouring eventual Chinese unification and promoting a pan-Chinese identity, contrasted with those aspiring to formal international recognition and promoting a Taiwanese identity; into the 21st century, both sides have moderated their positions to broaden their appeal.