- "That's right... The Temple of Time is the entrance through which you can enter the Sacred Realm from our world. But the entrance is sealed with a stone wall called the Door of Time. And, in order to open the door, it is said that you need to collect three Spiritual Stones. And another thing you need...is the treasure that the Royal Family keeps along with this legend..."
- — Princess Zelda
The Door of Time (時の扉 Toki no Tobira?) is a magical door of stone that protects the Chamber of the Master Sword in the ancient Temple of Time. It serves as a barrier to the Sacred Realm, the abode of the mythical Triforce. The only way to open the Door of Time originally, and thus enter the Sacred Realm, is to collect the three Spiritual Stones; the Kokiri's Emerald, the Goron's Ruby, and the Zora's Sapphire; place the stones on the Temple of Time's altar, and play the "Song of Time" on the Ocarina of Time. These actions will cause the door to open and yield access to the Chamber of the Master Sword. The Blade of Evil's Bane, the Master Sword, is the final key to the Sacred Realm and can only be removed from the Pedestal of Time by the true Hero of Time or his successors.
On the orders of Princess Zelda, Link, the Hero of Time, collects the Spiritual Stones and obtains the Ocarina of Time from Princess Zelda, along with knowledge of the "Song of Time". She asks of Link to get to the Sacred Realm before the evil Gerudo King Ganondorf and to protect the Triforce from him. Link travels to the Temple of Time near Hyrule Castle Town and places the three Spiritual Stones on the altar. After playing the "Song of Time" on the Ocarina of Time, the Door of Time opens, granting the Hero of Time access to the Chamber of the Master Sword. After removing the sword from the Pedestal of Time, Link is suspended in time for seven years until he becomes of proper age to wield the Master Sword. Ganondorf successfully enters the Sacred Realm through the portal Link has opened, shattering the Triforce in an event known as the Great Cataclysm. At the end of the Imprisoning War, after Princess Zelda sends Link back to his own age to regain his childhood, he returns the Master Sword to the Pedestal of Time, parts ways with Navi (who disappears into the window behind the Pedestal of Time), and closes the Door of Time once again.
In the game, there are stone blocks that bear the same carvings as the Door of Time which can be moved with the help of the "Song of Time".
Link of Ordon Village eventually finds his way to the Sacred Grove, the former site of the Temple of Time, in search of the Hero of Time's famous weapon, the Master Sword. After obtaining the Blade of Evil's Bane and going in search of the Mirror of Twilight, Link finds that he has to locate three fragments of the mirror, which was shattered by Zant. He is informed by the Ancient Sages of the Arbiter's Grounds that one of them is hidden in an "ancient grove".
Link eventually discovers that this is none other than the Sacred Grove where he had obtained the Master Sword and thus, he returns to the ruins of the Temple of Time. There, he stabbed the Pedestal of Time once, prompting a statue to move and reveal an entrance to the ruins of the former temple. Link steps forward and opens the Door of Time, and as he walks through it, it transports him back through time's flow to the time when the Temple of Time stood tall in the Sacred Grove in the days of the Hero of Time, showing that it also had other magical properties including time travel. This permits Link to enter the structure and search for the lost shard of the Mirror of Twilight.
Inscribed on the door guarding the entrance to the ruins of the Temple of Time, in Hylian, are the words "Time Door", implying that this could be the Door of Time that once guarded the Chamber of the Master Sword. If this is the case, it would mean that the Hylian people transferred the Door of Time from its original place guarding the Chamber of the Master Sword to the main door of the Temple of Time itself before the area was abandoned and the Temple of Time fell into ruin. No door is present where the Door of Time was originally located in either time, which may also suggest it was moved.