1 192, Yuan Laichao established a shogunate in Kamakura, and Japan entered the Kamakura era. During the Kamakura shogunate period, although the real political center of Japan moved to Kamakura, Kyoto remained the largest city and the residence of the emperor.
1338, with the establishment of the Muromachi shogunate, Japan entered the Muromachi era, and Kyoto once again became the political center of Japan.
1868, the Japanese capital moved from Kyoto to Tokyo. In addition to the royal family and the government, a large number of businessmen moved from Kyoto to Tokyo.
That is to say, Kyoto was the capital of Japan until Emperor Kanmu moved its capital to Pingan in 794 AD and Tokyo was established in 868 AD/KLOC-0.