A drop of sunlight falls to the ground and grows into a magical flower, with the power to heal the sick and injured. An old woman named Gothel finds it and uses it to keep herself young by singing an incantation. At the same time, a kingdom develops on a nearby island, ruled by an idealistic king and queen. The Queen becomes ill during pregnancy, and the couple's loving subjects search for the legendary flower. The queen is eventually fed the flower, is healed, and gives birth to a daughter, whom they name Rapunzel. Rapunzel's golden hair, it is found, has absorbed the magical abilities of the flower. Gothel kidnaps Rapunzel and hides her in a tower, saving the powers of the magic flower for herself, and raising her as her own child. Every year, on Rapunzel's birthday, her kingdom releases thousands of sky lanterns, in the hope that the lost princess will return. Years later, Rapunzel asks Gothel to let her see the floating lights, but Gothel refuses.
Meanwhile, the charismatic Flynn Rider and accomplices steal the tiara of the lost princess. During the ensuing chase, Maximus the horse is separated from his rider, the Captain of the Guards, and continues the search for Flynn on his own. Flynn outwits his accomplices, takes the tiara, and stumbles upon Rapunzel's tower, only to be knocked unconscious by Rapunzel. When Gothel returns, Rapunzel requests, as a birthday present, a special paint found only on a faraway beach. Gothel leaves on the long journey to bring back the gift. Rapunzel takes Flynn out of her closet and tells him that she will give him the tiara if he takes her to see the lights. Flynn takes her to the Snuggly Duckling Inn, which is full of Gaul thugs, in hopes of scaring her into giving up her quest, but the thugs are charmed by Rapunzel, who encourages them to follow their dreams.
Mother 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 Rapunzel and Flynn have escaped. The pursuit ends at a dam, which Maximus causes 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. Using her power, they find a way out. Later, when Flynn goes to gather firewood, Gothel meets Rapunzel, insisting that Flynn does not care for her and merely wants the tiara. Gothel gives Rapunzel the tiara, suggesting that she test Flynn by giving it to him.
The next morning, Maximus confronts Flynn, but Rapunzel befriends the horse and convinces him to help them instead. They arrive at the kingdom and Flynn takes Rapunzel to see the lanterns. There, Rapunzel gives Flynn back the tiara. Flynn spies his old accomplices and leaves Rapunzel waiting as he gives them the tiara back. However, the brothers tie him up on a boat and sail him across the lake. They reveal Flynn'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, Flynn is arrested and sentenced to death. Maximus brings the inn thugs to rescue Flynn, and Maximus and Flynn race back to the tower. From various clues she found during her adventure, Rapunzel realizes she is the lost princess and attempts to flee the tower. Flynn escapes and returns to the tower, climbing up Rapunzel's hair only to find her chained to the wall and gagged. Gothel stabs him from behind and prepares to take a struggling Rapunzel to a new hiding place. Rapunzel tells Gothel that she will not stop resisting unless she can heal Flynn. Knowing that Rapunzel keeps her word, Gothel agrees, but before Rapunzel heals him, Flynn cuts her hair, which turns brown and loses its power. Gothel rapidly begins to age and stumbles around the tower. Rapunzel's pet chameleon, Pascal causes her to trip and fall, disintegrating, from the tower.
Rapunzel tries to heal the dying Flynn, who with his last breath declares his love for her. Heartbroken, Rapunzel cries and sings the incantation. One teardrop, filled with her power, lands on his cheek and revives him. Back at the kingdom, the royal family has a tearful reunion. The King and Queen welcome Flynn into the family. Flynn and Rapunzel are engaged, soon to be married, the Gaul thugs each fulfill their individual dreams, and Maximus becomes a respected official on the Royal Guard.