The opera begins with the overture, which Mozart composed last.
Act 1
Scene 1: A rough, rocky landscape
Tamino, a handsome prince lost in a distant land, is pursued by a serpent and asks the gods to save him (aria: "Zu Hilfe! Zu Hilfe!" segued into trio: "Stirb, Ungeheuer, durch uns're Macht!"). He faints, and three ladies, attendants of the Queen of the Night, appear and kill the serpent. They find the unconscious prince extremely attractive, and each of them tries to convince the other two to leave. After arguing, they reluctantly decide to leave together.
Tamino wakes up, and is surprised to find himself still alive. Papageno enters dressed as a bird. He describes his life as a bird-catcher, complaining he has no wife or girlfriend (aria: "Der Vogelfänger bin ich ja"). Tamino introduces himself to Papageno, thinking Papageno killed the serpent. Papageno happily takes the credit – claiming he strangled it with his bare hands. The three ladies suddenly reappear and instead of giving Papageno wine, cake and figs, they give him water, a stone and place a padlock over his mouth as a warning not to lie. They give Tamino a portrait of the Queen of the Night's daughter Pamina, with whom Tamino falls instantly in love (aria: "Dies Bildnis ist bezaubernd schön" / This image is enchantingly beautiful).
The ladies return and tell Tamino that Pamina has been captured by Sarastro, whom they describe as a powerful, evil demon. Tamino vows to rescue Pamina. The Queen of the Night appears and promises Tamino that Pamina will be his if he rescues her from Sarastro (Recitative and aria: "O zittre nicht, mein lieber Sohn" / Oh, tremble not, my dear son!). The Queen leaves and the ladies remove the padlock from Papageno's mouth with a warning not to lie any more. They give Tamino a magic flute which has the power to change sorrow into joy. They tell Papageno to go with Tamino, and give him (Papageno) magic bells for protection. The ladies introduce three child-spirits, who will guide Tamino and Papageno to Sarastro's temple. Together Tamino and Papageno set forth (Quintet: "Hm! Hm! Hm! Hm!").
Scene 2: A room in Sarastro's palace
Pamina is dragged in by Sarastro's slaves, apparently having tried to escape. Monostatos, a blackamoor and chief of the slaves, orders the slaves to chain her and leave him alone with her. Papageno, sent ahead by Tamino to help find Pamina, enters (Trio: "Du feines Täubchen, nur herein!"). Monostatos and Papageno are each terrified by the other's strange appearance and both flee. Papageno returns and announces to Pamina that her mother has sent Tamino to save her. Pamina rejoices to hear that Tamino is in love with her. She offers sympathy and hope to Papageno, who longs for a wife. Together they reflect on the joys and sacred duties of marital love (duet: "Bei Männern welche Liebe fühlen").
Finale. Scene 3: A grove in front of a temple
The three child-spirits lead Tamino to Sarastro's temple, promising that if he remains patient, wise and steadfast, he will succeed in rescuing Pamina (Quartet: "Zum Ziele führt dich diese Bahn"). Tamino approaches the left-hand entrance and is denied access by voices from within. The same happens when he goes to the entrance on the right. But from the entrance in the middle, an old priest appears and lets Tamino in. (The old priest is referred to as "The Speaker" in the libretto, but his role is a singing role.) He tells Tamino that Sarastro is benevolent, not evil, and that he should not trust the Queen of the Night. He promises that Tamino's confusion will be lifted when Tamino approaches the temple in a spirit of friendship. Tamino plays his magic flute. Animals appear and dance, enraptured, to his music. Tamino hears Papageno's pipes sounding offstage, and hurries off to find him (aria: "Wie stark ist nicht dein Zauberton").
Papageno and Pamina enter, searching for Tamino (trio: "Schnelle Füße, rascher Mut"). They are recaptured by Monostatos and his slaves. Papageno plays his magic bells, and Monostatos and his slaves begin to dance, and exit the stage, still dancing, mesmerised by the beauty of the music (chorus: "Das klinget so herrlich"). Papageno and Pamina hear the sound of Sarastro's retinue approaching. Papageno is frightened and asks Pamina what they should say. She answers that they must tell the truth. Sarastro enters, with a crowd of followers. (chorus: "Es lebe Sarastro!")
Pamina falls at Sarastro's feet and confesses that she tried to escape because Monostatos had forced his attentions on her. Sarastro receives her kindly and assures her that he wishes only for her happiness. But he refuses to return her to her mother, whom he describes as a proud, headstrong woman, and a bad influence on those around her. Pamina, he says, must be guided by a man.
Monostatos brings in Tamino. The two lovers see one another for the first time and embrace, causing indignation among Sarastro's followers. Monostatos tells Sarastro that he caught Papageno and Pamina trying to escape, and demands a reward. Sarastro, however, punishes Monostatos for his lustful behaviour toward Pamina, and sends him away. He announces that Tamino must undergo trials of wisdom in order to become worthy as Pamina's husband. The priests declare that virtue and righteousness will sanctify life and make mortals like gods ("Wenn Tugend und Gerechtigkeit").
Act 2
Scene 1: A grove of palms
The council of priests of Isis and Osiris, headed by Sarastro, enters to the sound of a solemn march. Sarastro tells the priests that Tamino is ready to undergo the ordeals that will lead to enlightenment. He invokes the gods Isis and Osiris, asking them to protect Tamino and Pamina (Aria and chorus: "O Isis und Osiris").
Scene 2: The courtyard of the Temple of Ordeal
Tamino and Papageno are led in by two priests for the first trial. The two priests advise Tamino and Papageno of the dangers ahead of them, warn them of women's wiles and swear them to silence (Duet: "Bewahret euch von Weibertücken"). The three ladies appear and try to frighten Tamino and Papageno into speaking. (Quintet: "Wie, wie, wie") Papageno cannot resist answering the ladies, but Tamino remains aloof, angrily instructing Papageno not to listen to the ladies' threats and to keep quiet. Seeing that Tamino will not speak to them, the ladies withdraw in confusion.
Scene 3: A garden
Pamina is asleep. Monostatos approaches and gazes upon her with rapture. (Aria: "Alles fühlt der Liebe Freuden") He is about to kiss the sleeping Pamina, when the Queen of the Night appears. Monostatos hides. In response to the Queen's questioning, Pamina explains that Tamino is joining Sarastro's brotherhood and she is thinking of accompanying him too. The Queen is not pleased. She explains that her husband was the previous owner of the temple and on his deathbed, gave the ownership to Sarastro instead of her, rendering the Queen powerless (this is in the original libretto, but is usually omitted from modern productions, to shorten the scene with Pamina and her mother). She gives Pamina a dagger, ordering her to kill Sarastro with it and threatening to disown her if she does not. (Aria: "Der Hölle Rache kocht in meinem Herzen"). She leaves. Monostatos returns and tries to force Pamina's love by threatening to reveal the Queen's plot, but Sarastro enters and drives him off. Pamina begs Sarastro to forgive her mother and he reassures her that revenge and cruelty have no place in his domain (Aria: "In diesen heil'gen Hallen").
Scene 4: A hall in the Temple of Ordeal
Tamino and Papageno are led in by priests, who remind them that they must remain silent. Papageno complains of thirst. An old woman enters and offers Papageno a cup of water. He drinks and teasingly asks whether she has a boyfriend. She replies that she does and that his name is Papageno. She disappears as Papageno asks for her name, and the three child-spirits bring in food, the magic flute, and the bells, sent from Sarastro (Trio: "Seid uns zum zweiten Mal willkommen"). Tamino begins to play the flute, which summons Pamina. She tries to speak with him, but Tamino, bound by his vow of silence, cannot answer her, and Pamina begins to believe that he no longer loves her. (Aria: "Ach, ich fühl's, es ist verschwunden") She leaves in despair.
Scene 5: The pyramids
The priests celebrate Tamino's successes so far, and pray that he will succeed and become worthy of their order (Chorus: "O Isis und Osiris"). Pamina is brought in and Sarastro instructs Pamina and Tamino to bid each other farewell before the greater trials ahead, alarming them by describing it as their "final farewell". (Trio: Sarastro, Pamina, Tamino – "Soll ich dich, Teurer, nicht mehr sehn?" Note: In order to preserve the continuity of Pamina's suicidal feelings, this trio is sometimes performed earlier in act 2, preceding or immediately following Sarastro's aria "O Isis und Osiris".) They exit and Papageno enters. The priests grant his request for a glass of wine and he expresses his desire for a wife. (Aria: "Ein Mädchen oder Weibchen"). The elderly woman reappears and warns him that unless he immediately promises to marry her, he will be imprisoned forever. When Papageno promises to love her faithfully (muttering that he will only do this until something better comes along), she is transformed into the young and pretty Papagena. Papageno rushes to embrace her, but the priests drive him back, telling him that he is not yet worthy of her.
Finale. Scene 6: A garden
The three child-spirits hail the dawn. They observe Pamina, who is contemplating suicide because she believes Tamino has abandoned her. The child-spirits restrain her and reassure her of Tamino's love. (Quartet: "Bald prangt, den Morgen zu verkünden").
Scene change without interrupting the music, to Scene 7: Outside the Temple of Ordeal
Two men in armor lead in Tamino. They recite one of the formal creeds of Isis and Osiris, promising enlightenment to those who successfully overcome the fear of death ("Der, welcher wandert diese Strasse voll Beschwerden"). This recitation takes the musical form of a Baroque chorale prelude, to a tune inspired by Martin Luther's hymn "Ach Gott, vom Himmel sieh darein" (Oh God, look down from heaven).Tamino declares that he is ready to be tested. Pamina calls to him from offstage. The men in armour assure him that the trial by silence is over and he is free to speak with her. Pamina enters and declares her intention to undergo the remaining trials with him. She hands him the magic flute to help them through the trials ("Tamino mein, o welch ein Glück!"). Protected by the music of the magic flute, they pass unscathed through chambers of fire and water. Offstage, the priests hail their triumph and invite the couple to enter the temple.
Scene change without interrupting the music, to Scene 8: A garden with a tree
Papageno despairs at having lost Papagena and decides to hang himself (Aria/Quartet: "Papagena! Papagena! Papagena! Weibchen, Täubchen, meine Schöne") The three child-spirits appear and stop him. They advise him to play his magic bells to summon Papagena. She appears and, united, the happy couple stutter in astonishment and make bird-like courting sounds at each other. They plan their future and dream of the many children they will have together (Duet: "Pa... pa... pa...").
Scene change without interrupting the music, to Scene 9: A rocky landscape outside the temple; night
The traitorous Monostatos appears with the Queen of the Night and her three ladies. They plot to destroy the temple ("Nur stille, stille") and the Queen confirms that she has promised her daughter Pamina to Monostatos. But before the conspirators can enter the temple, they are magically cast out into eternal night.
Scene change without interrupting the music, to Scene 10: The Temple of the Sun
Sarastro announces the sun's triumph over the night, and hails the dawn of a new era of wisdom and brotherhood. Animals appear again and dance in the sun.