Útgarða-Loki (Old Norse: Útgarða-Loki, meaning ‘Loki of the Outer Enclosures’) is the ruler of the giant realm Útgarðr and the master of illusion who hosts Thor, Loki, and their companions in one of the most extended and narratively elaborate episodes in the Prose Edda. Despite the name, Útgarða-Loki is a distinct figure from the god Loki and should not be conflated with him.
In the episode, Thor and his companions are subjected to a series of contests in which they are defeated: Loki loses an eating contest to a figure named Logi; Þjálfi loses a running race to Hugi; Thor fails to drain a drinking horn, to lift a cat from the floor, and to wrestle an old woman named Elli. At the end of the visit, Útgarða-Loki reveals that the contests were illusions: Logi was fire, Hugi was thought, the horn was connected to the ocean, the cat was Jörmungandr, and Elli was old age. Útgarða-Loki disappears along with the entire castle when Thor raises Mjölnir in anger.
The episode is preserved only in Gylfaginning and has no direct parallel in the Poetic Edda.

