Malaysia is a country in Southeast Asia. The federal constitutional monarchy consists of 13 states and three federal territories, separated by the South China Sea into two similarly sized regions, Peninsular Malaysia and East Malaysia (Malaysian Borneo). Peninsular Malaysia shares a land and maritime border with Thailand in the north and maritime borders with Singapore in the south, Vietnam in the northeast, and Indonesia in the west. East Malaysia shares land and maritime borders with Brunei and Indonesia and a maritime border with the Philippines and Vietnam. Kuala Lumpur is the national capital and largest city while Putrajaya is the seat of federal government. With a population of over 30 million, Malaysia is the world's 44th most populous country. The southernmost point of continental Eurasia, Tanjung Piai, is in Malaysia. In the tropics, Malaysia is one of 17 megadiverse countries, with large numbers of endemic species.
Malaysia has its origins in the Malay kingdoms which, from the 18th century, became subject to the British Empire when the Straits Settlements became British protectorates. Peninsular Malaysia was unified as the Malayan Union in 1946. Malaya was restructured as the Federation of Malaya in 1948, and achieved independence on 31 August 1957. Malaya united with North Borneo, Sarawak, and Singapore on 16 September 1963 to become Malaysia. In 1965, Singapore was expelled from the federation. The country is multi-ethnic and multi-cultural, which plays a large role in its politics. About half the population is ethnically Malay, with large minorities of Malaysian Chinese (the second largest community of Overseas Chinese in the world), Malaysian Indians, and indigenous peoples. The constitution grants freedom of religion but recognises Islam as the established religion of the state. The government system is closely modelled on the Westminster parliamentary system and the legal system is based on common law. The head of state is the king, known as the Yang di-Pertuan Agong. He is an elected monarch chosen from the hereditary rulers of the nine Malay states every five years. The head of government is the Prime Minister. The country's official language is Bahasa Melayu, commonly known as the Malay language. English remains an active second language. In 2017, English proficiency in Malaysia was ranked the 2nd best in Asia (after Singapore) and the 13th best in the world.
Thailand (ประเทศไทย), officially the Kingdom of Thailand and formerly known as Siam (สยาม), is a country at the center of the Southeast Asian Indochinese peninsula composed of 76 provinces. At 513,120 km2 and over 68 million people, Thailand is the world's 50th largest country by total area and the 21st-most-populous country. The capital and largest city is Bangkok, a special administrative area. Thailand is bordered to the north by Myanmar and Laos, to the east by Laos and Cambodia, to the south by the Gulf of Thailand and Malaysia, and to the west by the Andaman Sea and the southern extremity of Myanmar. Its maritime boundaries include Vietnam in the Gulf of Thailand to the southeast, and Indonesia and India on the Andaman Sea to the southwest. Although nominally a constitutional monarchy and parliamentary democracy, the most recent coup in 2014 established a de facto military dictatorship.
Tai peoples migrated from southwestern China to mainland Southeast Asia from the 11th century; the oldest known mention of their presence in the region by the exonym Siamese dates to the 12th century. Various Indianised kingdoms such as the Mon, the Khmer Empire and Malay states ruled the region, competing with Thai states such as Ngoenyang, the Sukhothai Kingdom, Lan Na and the Ayutthaya Kingdom, which rivaled each other. European contact began in 1511 with a Portuguese diplomatic mission to Ayutthaya, one of the great powers in the region. Ayutthaya reached its peak during cosmopolitan Narai's reign (1656–88), gradually declining thereafter until being ultimately destroyed in 1767 in a war with Burma. Taksin quickly reunified the fragmented territory and established the short-lived Thonburi Kingdom. He was succeeded in 1782 by Buddha Yodfa Chulaloke, the first monarch of the Chakri dynasty and founder of the Rattanakosin Kingdom, which lasted into the early 20th century.