Rapunzel, a long-lost princess, lives isolated in a tower with Gothel, whom she believes is her mother. Gothel had kidnapped Rapunzel when she was a baby because of her magical golden hair that kept her young. She knew Rapunzel's magical hair, if cut, would turn brown and lose its magic. Every year on Rapunzel's birthday, her kingdom sends thousands of lanterns into the sky wishing their lost princess would return. On her eighteenth birthday, Rapunzel asks Gothel to let her see the floating lights, but Gothel says no because the world is full of dangers.
Meanwhile, thieves led by Flynn Rider steal the tiara of the missing princess from the castle and are chased by the kingdom guards. During the chase, the lead guard's horse, Maximus, is separated from his rider and continues the search for Flynn on his own. Flynn outwits his accomplices by taking the tiara; he abandons them and stumbles upon Rapunzel's tower. Once inside the tower, Flynn is knocked unconscious by Rapunzel with a frying pan. She hides Flynn and his satchel.
When Gothel returns, Rapunzel requests a special paint for her birthday instead. Gothel leaves for a three-day journey to bring the gift. Then Rapunzel makes a deal with Flynn: a journey to the "lights" in exchange for the tiara. Flynn attempts to make Rapunzel end their journey by taking her to the Snuggly Duckling Parlor. It is full of Viking thugs, but they are charmed by Rapunzel.
Gothel sees Maximus riderless and worries someone will find Rapunzel; she returns to the tower to find Rapunzel gone. Meanwhile, the guards invade the tavern, but the thugs help the pair escape. The pursuit ends at a dam, which Maximus caused to collapse. Flynn and Rapunzel are trapped in a flooding cave. Believing he's about to die, Flynn admits his true name: Eugene Fitzherbert. Rapunzel admits she has magic hair that glows when she sings. When it glows, they find a way out. Later around a campfire, Rapunzel heals Eugene's cut with her magic hair. When Eugene goes to gather firewood, Gothel secretly meets Rapunzel. Gothel tells Rapunzel that Eugene doesn't care for her, he only wants the tiara; giving her the satchel, Gothel insists that Rapunzel test Eugene by giving it to him.
The next morning, Maximus confronts Eugene, but to Eugene's dismay Rapunzel befriends the horse. The three arrive at the kingdom and that night Eugene takes Rapunzel to see the lanterns. There, Rapunzel gives Eugene back his satchel. Eugene spies his former accomplices and leaves Rapunzel waiting as he gives them the tiara back. However, the pair knock him out, tie him on a boat and sail him across the lake. They reveal Eugene's "betrayal" to Rapunzel as they attempt to kidnap her for her hair's power, but Gothel rescues her and they return to the tower. Later, Eugene is arrested and sentenced to death. Maximus brings The Snuggly Duckling thugs to rescue Eugene, and horse and rider race to the tower.
From various clues she finds during her adventure, Rapunzel realizes she is the long-lost princess and attempts to flee the tower. Gothel binds her, and when Eugene arrives, Gothel stabs him. Rapunzel swears to keep fighting Gothel unless she is allowed to heal Eugene's wound. Gothel agrees but before she heals him Eugene cuts Rapunzel's hair short with a piece of broken mirror. Rapunzel's hair turns brown and loses its magic. Gothel rapidly begins to age; while delirious, she trips and falls from the tower turning into dust. Eugene slowly dies in Rapunzel's arms. As she cries over his body, a teardrop filled with her magic lands on his cheek and revives him. Back at the kingdom the royal family has a tearful reunion and the king and queen pull Eugene into their embrace. Years later, Eugene and Rapunzel are married. Along the way the pub thugs fulfill their individual dreams, and Maximus becomes a respected official on the Royal Guard.