The complex relationship between Japan and Taiwan dates back to 1592 during the Sengoku period of Japan when the Japanese ruler Toyotomi Hideyoshi sent an envoy named Harada Magoshichirou to the Takasago Koku 高砂国 (Taiwan). The bilateral trading relations continued through the Dutch colonial rule and the Tungning Kingdom of Taiwan in 17th century before the completion of Japan's Sakoku policy. After the Meiji restoration in latter half of the 19th century, Japan resumed its expansionist ambition upon Taiwan and successfully annexed Taiwan under Japanese rule from 1895 to 1945, until the surrender of Japan after World War II. Taiwan was also surrendered by Japan to the Republic of China on 25th October 1945.
 After the Japan–China Joint Communiqué in 1972, Japan no longer recognizes the Republic of China as the sole official government of China and the official diplomatic relations between the two countries were ceased. However, Japan has maintained non-governmental, working-level relations with Taiwan.
 In the 1600s, there was considerable trade between Japan and Taiwan. The Dutch colonized Taiwan as a base for trade with Japan in 1624.
 During the Kingdom of Tungning era (1662–83), Japan bought deerskin, sugar and silk from Taiwan and sold precious metal, porcelain, armors and cotton cloth. Japanese money could be used in Taiwan during that period and Japanese merchants were permitted to live in Keelung.
 In 1874, Japanese troops invaded southern Taiwan to attack aboriginal tribes, in revenge for the killing of 54 Ryukyuan sailors in 1871.
 Japan's victory over Qing dynasty in the First Sino-Japanese War resulted in the 1895 Treaty of Shimonoseki, in which Taiwan was ceded to Japan. Taiwan was then ruled by the Empire of Japan until 1945. The Japanese Imperial Army defeated the native aborigine rebels in the Tapani incident of 1915 and the Musha Incident of 1930.
 During that time, Taiwan was Japan's first colony and can be viewed as the first step in implementing their "Southern Expansion Doctrine" of the late 19th century. Japanese intentions were to turn Taiwan into a showpiece "model colony" with much effort made to improve the island's economy, public works, industry, cultural Japanization, and to support the necessities of Japanese military aggression in the Asia-Pacific.
 After Japan's surrender at the end of World War II, Taiwan was placed under the governance of the Republic of China.
 After the war between China and Japan, during the occupation of Japan, Prime Minister Shigeru Yoshida (officially the last prime minister under the royal decree by the Japanese emperor), intended to approach the newly established People's Republic of China economically and diplomatically. However, the US rectified this initiative and threatened to boycott the 1951 Treaty of San Francisco if Japan did not engage with KMT-led Nationalist China (now Taiwan) and the later formation of the Treaty of Taipei (a parallel treaty to the Treaty of San Francisco between Japan and the two Chinas that were excluded). The US required Japan to accept diplomatic relations with the KMT-led Nationalist China; otherwise, sovereignty to the country would not be restored, effectively maintaining war with the US and keeping it under US military occupation.
 By taking everything into consideration, in the midst of the US creating its containment policy in Asia, Prime Minister Yoshida shifted his stance with regard to the US administration (to then-US Secretary of State John Foster Dulles), as detailed in the Yoshida Letter, to negotiate a peace treaty with Taipei instead. Also as a result of ratification of the Treaty of San Francisco by the US Congress and Senate, he officially ended Japan's status as an imperial power, officially relinquishing of the island of Taiwan and Pescadores. These actions were drafted into Article 9 of the new liberal democratic Japanese Constitution which dismantled the country's military capabilities to declare war on another country with the reservation of self-defense limitations and later stipulated the Security Treaty Between the United States and Japan, which was also passed and enacted by the majority members of the new Japanese Diet with subsequent security treaties in the post-war era.
 With the eruption of the Korean War and US and UN intervention in that war, diplomatic relations between the governments of Japan and KMT-led Nationalist China were established following the termination of US occupation of Japan in 1952. Japan led the logistics and artillery production/manufacturing industry to support the US in the Korean War, which acted as the major stimulus for the revival of its economy, especially in heavy and light industry, soon evident in the Japanese post-war economic miracle. On April 28, 1952, a formal peace treaty was concluded between Japan and what is now Taiwan, as the former refrained from recognizing the People's Republic of China at that time. In Article 10 of the Treaty of Taipei (Sino-Japanese Peace Treaty) that retrospects:[clarification needed]
 for the purposes of the present Treaty, nationals of the Republic of China shall be deemed to include all the inhabitants and former inhabitants of (Taiwan (Formosa)) and Penghu (the Pescadores) and their descendants who are of Chinese nationality in accordance with the laws and regulations which have been or may hereafter be enforced by the Republic of China in Taiwan (Formosa) and Penghu (the Pescadores); and juridical persons of the Republic of China shall be deemed to include all those registered under the laws and regulations which have been or may hereafter be enforced by the Republic of China in Taiwan (Formosa) and Penghu (the Pescadores). Bilaterally, Japan had, and still has from members of the Japan Business Federation, strong trading ties with Taipei. Japan played a key financial role of governmental loans to the ROC government to help with the burgeoning country's economic development on various levels before the Nixon Shock and the severing of ties between the two governments.
 In 1958, the Sino-Ryukyuan Economic and Cultural Association was established at Naha, Okinawa, which was the strategic headquarters of the US Armed Forces in the region. In 1972, Okinawa was returned to Japan by the U.S., but the association remained as an institution to foster relations, dialogue and academic exchange between Japan, Okinawa and Taiwan.
 Regarding the One-China policy, Japan had been an earnest ally to Taiwan, but global politics pushed Japan to overturn its position. As the attempt to belligerently recover mainland China failed and faded and the Taipei-based government was expelled, voted out of UN in a General Assembly vote, by majority UN member states via United Nations General Assembly Resolution 2758 (Japan voted against ominous UNGA Resolution 2758), soon after US President Richard Nixon's visit to People's Republic of China in 1972 and the release of the "Joint Communiqué of the United States of America and the People's Republic of China," Japan's Liberal Democratic Party-majority government led by Kakuei Tanaka decided to establish formal diplomatic relations with the PRC. Before this, Japan had already had robust non-governmental trading relations with the PRC without formal diplomatic recognition. According to NY Times, about one month before Japanese Prime Minister Tanaka travelled to Beijing, Japanese business representatives informed to Taiwanese business associates and employees in Taipei about maintaining economic relations between Japan and Taiwan even after the State of Japan diplomatically recognized P.R.C government.
 As a pre-condition for building ties with the PRC, Japan abrogated and made defunct the Treaty of Taipei in relation to then non-recognized Taiwan polity. According to the "1972 Japan–China Joint Communiqué", the Japanese government fully understood and respected the position of the government of the People's Republic of China (PRC) that Taiwan was an inalienable territory of the PRC, and it firmly maintained its stand under Article 8 of the Potsdam Proclamation, which stated "The terms of the Cairo Declaration shall be carried out and Japanese sovereignty shall be limited to the islands of Honshū, Hokkaidō, Kyūshū, Shikoku and such minor islands as we determine."
 Statements and principles set in the Joint Communiqué of 1972 were written in the Treaty of Peace and Friendship between Japan and the People's Republic of China in 1978. Japan and the PRC agreed to continue abiding by the treaty when former Prime Minister of Japan Shinzo Abe visited Beijing on October 8, 2006.
 In 1998, Japan and the PRC signed the Japan–China Joint Declaration on Building a Partnership of Friendship and Cooperation for Peace and Development that stated that Japan was to continue to side with the PRC on the One-China policy, that it "continues to maintain its stand on the Taiwan issue as set forth in the Joint Communiqué of the Government of Japan and the Government of the People's Republic of China and reiterates its understanding that there is only one China." Japan reiterated it will maintain its exchanges with Taiwan, however in a private and regional forms.
 Japan grants Taiwanese passport holders visa exemption for 90 days. This rule became effective on September 20, 2005, in line with a move aimed at attracting more tourists to Japan. Jiro Akama, Deputy Minister of Internal Affairs and Communication was the highest ranking cabinet official since 1972 to visit Taiwan on March 25 to celebrate the tourist event and promote Japanese regional revitalization, amid with the ban of Japanese agricultural exports to Taiwanese public.
 In the press conference on January 31, 2006, Deputy Press Secretary Tomohiko Taniguchi announced that, in a speech a year earlier, Minister of Foreign Affairs Tarō Asō had expressed concern regarding peace and stability across the Taiwan Strait on the basis of the 1972 Japan–PRC Joint Communiqué. The announcement reiterated the Japanese government's position "that we do not take a policy of two Chinas or one China and one Taiwan."
 In 2020 Japan received donations of equipment and supplies as part of Taiwan's medical diplomacy in response to the COVID-19 epidemic. More than 2 million face masks were delivered in mid April 2020.
 As the People's Republic of China banned Taiwan pineapples, the Japanese representative office in Taipei expressed support for Taiwanese pineapple consumption, and Taiwan pineapples became a hot commodity in Japan.
 Japan has been drawing closer to Taiwan as a result of their concerns over Beijing's economic and military power. In 2021 Japan's annual military white paper explicitly mentioned Taiwan for the first time.
 In September 2021, Taiwan donated 10000 pulse oximeters and 1008 oxygen concentrators to Japan Japan Prime Minister Yoshihide Suga thanked Taiwan for the medical equipment, including a "Thank you Taiwan" written in Taiwan's traditional Chinese characters, and adding that Japan and Taiwan have cultivated their friendship by helping each other in times of natural disasters and pandemics.
 On July 12, 2022, Taiwanese Vice President Lai Ching-te attended the funeral of Shinzo Abe at Zōjō-ji temple. Lai was instructed by President Tsai Ing-wen to make a visit as "a special envoy".
 Japan insists, on the basis of United Nations Convention on the Law of the Sea, that Japan is privileged on the fishery demarcation to the southern tip of its surrounding territorial waters, whereas Taiwan asserts that it participates as a fishing entity in the Regional Fisheries Management Organisation on the basis of United Nations Fish Stocks Agreement, such as the admission of IATTC, that also applies on the issue of fishery demarcation with Japan. There were sixteen fishery conferences in total between the two stakeholders, Interchange Association, Japan and Association of East Asian Relations of Taiwan, on fishery demarcation from 1996 to 2009, and the dispute of exclusive economic zone between Japan and Taiwan   is still not resolved pertaining to future negotiations between the two sides. Despite this dispute, the two sides reached a fisheries resource management agreement on April 10, 2013.
 On the official international tie between the two governments, think tanks from Taiwan is a member of Asian Development Bank Institute, which is located in Kasumigaseki Building in Chiyoda, Tokyo.
 The Guang Hua Liao (Kokaryo) case involved the ownership of a dormitory that the ROC purchased in 1952 to house students, yet the PRC controlled and operated since the 1960s. The ROC, seeking to take control of the dormitory, asked the students to sign a lease contract, and when the ROC received no response, it filed a lawsuit as "the State of China" in Kyoto District Court in 1967, seeking removal of the students living in the dormitory. In 1977, 10 years after the ROC filed its original lawsuit, the Kyoto District Court gave a verdict: The dormitory belonged to the PRC. The case was appealed in 1982 to the Osaka High Court, which ordered the Kyoto District Court to reconsider its ruling. The Kyoto court did, and in February 1986 the decision was reversed and the dormitory was returned, in name, to the ROC. The Osaka High Court found in favor of Taiwan because of "incomplete succession of government" in the case of “the State of China.” In 2007, the Japanese Supreme Court quashed the decision. The Supreme Court held that Japan's recognition of Beijing in 1972 rendered the ROC's representation on behalf of "the State of China" invalid. Notably, the Japanese decision carefully focused on a narrow ground of standing as “the State of China,” which Japan recognizes as the PRC. It did not foreclose the possibility of refiling the case as the Republic of China.
 A few days after Japan was struck by the Tōhoku earthquake in March 2011, the Taiwanese government pledged to donate 100 million NTD to assist Japan. Many Taiwanese citizens and news media also followed suit and urged people to donate to Japan. By May 2012, Taiwan had donated up to 6.6 billion NTD from the government and private donations combined. By March 2013, donations had reached 260.64 million USD, which is the highest amount from any nation despite only having 23 million people. At this time, it is known that 90 percent of the amount came from private donations. Such number of donations have been the result of Japan's aid to Taiwan when a powerful earthquake hit Taiwan on September 21, 1999, sending a 145-person rescue team and donating 37 million USD in aid of the catastrophe. Taiwan's donations assisted Fukushima in performing several vital reconstructions, which include rebuilding schools and hospitals.
 Despite Taiwan being the nation that donated the most money to Japan in response to the earthquake, the government did not publicly thank Taiwan along with other nations. The Japanese government placed ads in multiple nations to show gratitude of the donations, but not Taiwan. This prompted Japanese citizens to thank Taiwan individually. Japanese designer Maiko Kissaka started a fundraiser on April 19, 2020, in an attempt to place ads on two newspapers to show gratitude to the Taiwanese people for donations. This started a series of attempts from individuals and organizations to thank Taiwan for the donations across the next few years. A notable organization named Arigatou Taiwan was created for the sole purpose of thanking Taiwan and planned to hold an event each year starting on 2012, and managed to include several earthquake survivors at the event in 2015. In 2018, local governments which were affected by the earthquake started fundraisers to show gratitude for Taiwan's help in 2011.
 The Japanese government did not hold any public activities to thank Taiwan at the first few years after the earthquake, and wrote a letter in private to the Taiwanese government to express gratitude instead. However, starting in 2014, the government started holding events publicly in Taiwan to express gratitude, starting from the governments of six prefectures in Japan collaborated for a four-day event in Taipei, Taiwan, aimed to repay the generosity during Japan's earthquake. During the 5th anniversary event of the 2011 earthquake in Taiwan, the ambassador to Taiwan from Japan described Taiwan as a "true friend" and further stated "With the gratitude for the generosity of our friends in Taiwan, we vow to try our best to strengthen the relationship between Japan and Taiwan." Japan also stated that its donations of 1.2 million USD to Taiwan due to a powerful earthquake hitting southern Taiwan is an attempt to repay Taiwan's generosity a few years ago. 
 In 2019, the 8th anniversary of the earthquake was held, in which the ambassador to Taiwan from Japan stated that "There was already a special bond between Japan and Taiwan before the disaster" and that "The northeastern Japan earthquake made [Japan] see it more clearly." These statements contradict what was suggested from Taiwanese newspapers which stated that the donations Taiwan contributed was a turning point between the relations of the two nations. However, it is undeniable that Taiwan and Japan's relations have strengthened a lot due to the exchanges after the catastrophe, both on a governmental and private level. In August 2019, The Japan Times published an article "Taiwan's democracy is worth defending", which demonstrates the improved relations as such controversial articles supporting Taiwan are rarely seen on large non-Taiwanese news media.
 Due to the closer relations Japan and Taiwan has after the catastrophic event, tourism bloomed between both nations. Japanese tourism to Taiwan rose by 19.9 percent in 2011, which comes with an increase of nearly 50 percent exchange revenue due to this change.
 In the context of the COVID-19 pandemic, Japan sent 1.24 million doses of vaccine to Taiwan for free on June 4, 2021. This prompted a wave of gratitude from Taiwanese people, while the Chinese Communist Party condemned Japan's move. This was followed by 5 other shipments over 2021, totaling 4.2 million doses, with the Japanese Ministry of Foreign Affairs saying it is an expression of warm friendship and good will.
 Overseas Chinese schools, like those in many other countries, are administratively and financially supported by the Taiwan (R.O.C.) government's Overseas Community Affairs Council. In Japan, before 2003, Overseas Chinese School graduates did not qualify for Japanese college entrance exam. The future task lies on the legalization of the Overseas Chinese School by the Japanese Government and international educational agency accreditation (such as International Baccalaureate, Cambridge International Examinations and Advanced Placement accreditation ), or similar international recognition of Taiwan's education, for qualifying the legal international status of Overseas Chinese School in Japan. Those supported by the ROC are:
 Japan operates three nihonjin gakkō (overseas Japanese schools operated by a Japanese association) on the island of Taiwan:
 On April 21, 2010, Taiwan established the Taipei Cultural Center in Tokyo, Japan and was subsequently renamed Taiwan Cultural Center. On November 27, 2017, Japan established the Japanese Cultural Center in Taipei, Taiwan.