To-ji was founded in 794 when emperor Kanmu moved the capital from Nara to Kyoto, and was thus one of the earliest Buddhist temple.
Toji literally means "East Temple", notwithstanding its location in the South-West corner of Kyoto. There once was a Sai-ji or "West Temple", and both temples stood alongside the Rasho-mon Gate, Kyoto's biggest and most famous gate during the Heian period (794-1185).
In 818, the emperor Saga confided the temple to the Buddhist priest Kukai (774-835, also known as Kobo Daishi), founder of the esoteric Shingon sect. To-ji's formal name, Kyo-o Gokoku-ji, means "protector of the nation".
Its five-tiered pagoda is 57m tall, making it the highest wooden tower in Japan. It was last built in 1643 after having burned five times.
Toji is listed on the UNESCO World Heritage list since 1994. Kobo-san market is held on the temple's premises on the 21st of each month.