Act 1
A public square at dusk; palace gates and a terrace on one side, on the other a tavern and a tailor's shop
Townspeople sing joyfully of the peace that will follow the imminent wedding of the prince of Mantua and the princess of Bavaria. Young people look forward to songs and dancing, and a group of prisoners released by the King celebrate. A group of impoverished students, Spark, Hartmann and Facio, enter hoping also to share in some fun while contemptuous of the townspeople. The King and his guards emerge from the palace. The King announces the arrival of the prince of Mantua to wed his daughter Elsbeth and encourages the celebration. A courtier explains that Elsbeth is grieving on the death of the court jester of whom she was fond. Marinoni, the prince of Mantua's aide-de-camp, enquires about the festivities and the princess, but is mocked by the students. Fantasio enters and sings a ballad to the moon. The page of Elsbeth enters to tell the students to keep their voices down as they will disturb the princess; they enter the tavern. Elsbeth sings of her wonder at the change in her life, but Fantasio enters unseen and asks her if she is really in love – with a complete stranger. Elsbeth, startled, leaves repeating Fantasio's words. When Spark joins his friend Fantasio talks extravagantly of his feelings. Soon the funeral cortege of court jester St Jean passes by and Fantasio has the idea to take the appearance of the jester to gain access to the princess, and he and Spark enter the nearby tailor's shop to get the costume. This will also help him avoid being arrested for his debts by the police. The fatuous prince of Mantua and his aide Marinoni enter, and the prince, wanting to discover the real thoughts and feelings of his future wife determines to dress as a servant to find out; he and Marinoni exit to exchange their clothes. The students come in singing and Fantasio re-appears dressed as the old jester. Two sentries mistakenly let him into the palace grounds and he looks forward to his adventure and to meeting Elsbeth again.
Act 2
Palace gardens
Elsbeth, her page and the ladies of the court are walking in the palace grounds. She does not want to talk about her future marriage but of the poor jester whom she so admired. She sends the others away but then discovers Fantasio who amuses her with his banter about the flowers; she is intrigued by the unknown jester. The king, the prince and Marinoni (disguised as each other) enter. Elsbeth is not impressed by the aide-de-camp's song. When she and Fantasio are alone he casts more doubt in her mind about going ahead with the liaison with the prince, and she longs for a reason to delay the union. The court enter and while Marinoni (as the prince) sings her a pompous song in praise of beauty Fantasio climbs a tree and with a stick lifts the wig from the head of the false prince. The marriage of the Mantuan prince is immediately compromised but Fantasio is taken away.
Act 3
1st tableau – a prison
Fantasio is delighted to have wrecked the wedding plans, but when Elsbeth visits him in his prison cell she says she must go ahead with the marriage to the prince of Mantua to avoid a diplomatic quarrel and help bring peace between the two kingdoms. Fantasio takes off all his disguise and sings his ballad from act 1. Hearing this romance she is moved, decides to help him elude the guards – who expect to see a hump-back jester, but not a young man – and gives him a key to the gardens.
2nd tableau – the courtyard in front of the king's palace
Back in his student clothes Fantasio calms his friends who were planning to get him out the palace prison and clamoring for revenge. Meanwhile the king and the prince are preparing to declare war. Fantasio challenges the prince of Mantua to a duel but the prince backs off, preferring to renounce marriage with Elsbeth and return to Mantua. Fantasio, whom the students have named "king of fools" pleads for peace, is pardoned by the king and Elsbeth names him prince for having avoided war. Fantasio offers her to return the key to the palace gardens she had given him, but she asks him to keep it.