The curtain opens on a trio of Storytellers sharing the tale of a little ogre named Shrek. Papa and Mama Ogre sit Shrek down and have a coming-of-age talk with their son, telling him that, since he is now seven years old, it is time for him to make his own place in the world, and he must leave home ("Big Bright Beautiful World"). As the years pass, Shrek transforms into an adult and finds contentment living alone in a swamp on the edge of the kingdom of Duloc. Suddenly, the Captain of the Guards appears, leading a large group of Fairy Tale Creatures into the swamp, including Pinocchio, the Big Bad Wolf, the Three Little Pigs, the Wicked Witch, Peter Pan, the Ugly Duckling and the Three Bears. The characters have been exiled from the kingdom of Duloc and banished to live in the swamp ("Story of My Life"). Shrek returns home to find his once private swamp now teeming with the new inhabitants and angrily sets off to confront the leader of Duloc about the injustice.
As Shrek makes his way through a dense forest, he encounters a screaming Donkey under pursuit by more Guards from Duloc. Shrek scares off the guards and, having lost his way (and despite his better judgment), reluctantly agrees to let Donkey be his guide. Meanwhile, in Duloc, the Guards sing of the "gentrification" of the kingdom ("What's Up, Duloc? – Part 1"). Lord Farquadd appears, questioning the captive Gingy as to the whereabouts of an available princess that Farquaad could marry in order to become king and justly gain control of all of Duloc. Threatened with torture, Gingy relinquishes the information – there is a princess in a tower that is guarded by a dragon and surrounded by boiling-hot lava. Just as Farquaad and the residents of Duloc begin to celebrate their future queen ("What's Up, Duloc? – Part 2"), Shrek and Donkey arrive. Shrek demands the swamp be rightfully returned to him and, seizing an opportunity, Farquaad agrees to find a new home for the Fairy Tale Creatures if Shrek retrieves the princess for him.
High in her tower, Young Fiona dreams of being rescued by a handsome prince and living the idyllic fairy tale dream ("I Know It's Today"). The years pass, and Fiona grows more anxious day after day, nervous that the stories she's read have misled her. Despite her frustrations, she remains hopeful.
Meanwhile, Donkey passes time on the long journey by singing ("Travel Song"). Shrek and Donkey arrive at the castle and, donning a knight's helmet that he finds in the castle for protection, Shrek tells Donkey to wait while he rescues the princess. Shrek climbs Fiona's tower while she excitedly prepares for the arrival of her prince. The meeting doesn't go quite as Fiona had planned, and she mistakes Shrek for a brave knight because of his helmet. Shrek doesn't have time to correct this oversight as Donkey is now being pursued by the Dragon. Cornered in the dungeon, four imprisoned Knights warn Donkey that he may wind up like them. The Dragon, frustrated that no one ever pursues her, sings of her loneliness ("Forever"). Falling madly in love with Donkey, the Dragon spares his life, but attacks Shrek when she sees he's freed Fiona. The two battle, and Fiona finally gets her storybook adventure ("This Is How a Dream Comes True").
Having escaped the dragon, the group sets off for Duloc. Shrek reveals to Fiona that he is actually an ogre and has rescued her for Lord Farquaad. As the sun sets, Fiona demands to set up camp and disappears into a cave for the duration of the night. The Storytellers reveal that Fiona has been placed under a curse causing her to live "by day one way, by night another."
The next morning, Fiona is chipper and highly caffeinated ("Morning Person"). She greets the woodland creatures, including the Pied Piper and his disorderly Rats, with cheerful optimism. The group continues their journey, and Shrek and Fiona bond over their horrible lives thus far ("I Think I Got You Beat"). The song ends in a gassy display of bravado, and the two become friends. Donkey is convinced that their relationship is actually a budding romance ("Make a Move").
Having reached Duloc, Fiona postpones meeting Lord Farquaad for one more night and retires to a nearby barn to sleep as the sun sets. That night, Donkey stumbles into the barn and discovers Fiona's secret – she has transformed into an ogress. Fiona explains that she has been cursed to live by day as a human, by night as an ogre, and sees Lord Farquaad as her only chance for happiness because no one could ever love an ugly ogre. Shrek, who has worked up the courage to tell Fiona how he feels about her, overhears only the last part of Fiona's conversation with Donkey from outside the barn, and thinks she is talking about him.
The next morning, Shrek admits to Fiona that he heard everything she said. Fiona now thinks that he knows her secret and is unable to love her because of it. Just then, Lord Farquaad arrives to claim Fiona. He hands over the deed to Shrek's swamp and makes plans to marry Fiona that night. Hurt, Fiona accepts and leaves with him. The Fairy Tale Creatures drudge on, having been evicted from the swamp. Donkey pleads with Shrek to try to win back Fiona, and the Fairy Tale Creatures agree that he must be proud of who he is rather than ashamed by it ("Freak Flag"). With a sense of empowerment and a plan of action, the group decides to return to Duloc.
Just as the Bishop is about to marry Fiona and Lord Farquaad, Shrek and the Fairy Tale Creatures burst in. Shrek professes his love for Fiona ("Big Bright Beautiful World – Reprise"), and the Fairy Tale Creatures reveal that Lord Farquaad's father is a grumpy Dwarf. The discovery that Farquaad is actually a "freak," like the Fairy Tale Creatures he condemned, shocks and surprises everyone. During this, the sun has gone down and Fiona has transformed into an ogress. Disgusted, Lord Farquaad claims that the marriage is binding – he is now king and shall lock Fiona back in the tower forever to rule Duloc himself. Just then, the Dragon crashes through the castle wall and heaves a fiery breath at Farquaad. Afterward, all that's left of him is his scorched crown. Shrek and Fiona finally share "true love's kiss" and, although the spell is broken, Fiona doesn't turn back into a human. Shrek convinces her that she is beautiful just as she is, and everyone celebrates their individuality ("Finale").