Inside the church of St Katherine
Walther von Stolzing, a young nobleman, has just come to Nuremberg and fallen in love with Eva, the daughter of Pogner, a rich goldsmith and mastersinger, one of the most important men of the town. After the church service Eva contrives a few minutes with Walther to explain, in answer to his eager questions, that, although she loves him, she is not free to marry. Her father has decided to offer her hand to the winner of a mastersinging contest to be held the next day, for the festival of St John, Midsummer's Day.
Eva's maid and companion, Magdalena, arranges for her sweetheart, the apprentice David, to prepare Walther for the contest, since only mastersingers are eligible to compete. David is horrified to discover that Walther knows nothing at all about the art of mastersinging and that he hopes to reach in one day a stage which requires years of painful study - such as he is undergoing himself as he studies singing as well as shoemaking under Hans Sachs, the greatest of the mastersingers.
Other apprentices are meanwhile arranging the church for a singing test. The mastersingers begin to arrive. First are Pogner and Beckmesser, the town clerk who wants to marry Eva and is trying to urge her father to put in a good word for him. Walther takes Pogner aside and explains that he wants to join the mastersingers guild. Beckmesser eyes him off suspiciously.
When the meeting begins Pogner announces that he intends to give his daughter and her dowry as a prize in the festival song contest. Sachs suggests that the people ought to have some say in the judging, since the contest is to be public, An argument develops between Sachs and Beckmesser, who clearly regards Sachs, a widower, as a rival for Eva's hand. Sachs enrages him by answering that they are both too old for a young girl. Pogner then presents Walther as a candidate for the guild. To prove his suitability he has to sing a song but is failed by Beckmesser, who acts as examiner.
Sachs defends the song and accuses Beckmesser of not being objective, but the other masters also reject the song, finding it too free and not in accordance with the strict rules of their craft. In the ensuing argument Beckmesser complains that Sachs should spend less time on poetry and more on the pair of shoes he has ordered for the next day.
Walther, failed in the test, leaves the church angrily.
A street between the houses of Pogner and Hans Sachs, the evening of the same day
Eva, having learned of Walther's failure to become a master, goes along to Sachs to find out the full story. He, still reflecting on the strange beauty of Walther's song, tests Eva's feelings. She responds so hotly to his disparaging remarks about Walther that he realises she loves him. He is now able to plan how to help the lovers.
When Walther comes along to find Eva he is still very angry with the masters and persuades Eva to elope with him. She goes inside to change clothes with Magdalena, so that she can escape unnoticed and also so that Magdalena can take her place at the window to listen to a serenade which Beckmesser is supposed to be singing to her that night.
Walther and Eva wait in the street for a chance to slip away but Sachs, inside his shop, has heard their plans and is determined to stop them from taking such a rash step, so he keeps a light shining across the street so they cannot get past unobserved. When Beckmesser begins his serenade Sachs begins to hammer and sing a vigorous cobbling song. To Beckmesser's objections he agrees to stop singing but points out that he has to keep hammering - to finish the shoes Beckmesser has been complaining about.
After some argument it is agreed that Sachs is to act as marker for Beckmesser's song, only hammering when he makes a mistake. But when Beckmesser sings the hammering is so fast and furious that the shoes are finished before the song. Then David sees Magdalena at the window and rushes out jealously to attack Beckmesser. People open their windows to see what is going on. Apprentices from rival guilds rush into the street and a general brawl develops, only broken off by the appearance of the night watchman.
Sachs manages to bundle Eva into her own house and pull Walther with him into his house just as they are on the point of running away in the confusion.
Scene 1: Inside Sachs' workshop, the next morning
Hans Sachs is in a reflective mood, thinking of the midsummer madness of the night before, but still eager to help Eva and Walther. Learning that Walther has had a dream he encourages him to make it into a song, teaching as he goes along how to frame it so as not to outrage too violently the mastersingers' rules and writing it down himself as Walther sings it. With the final stanza still uncomposed they go into another room to change their clothes, leaving the song on the bench.
Beckmesser comes in and pockets the song gleefully, thinking it is by Sachs. To his surprise, Sachs does not object when he finds out, but makes him a present of it. He is torn between gratitude, feeling certain that a song by Sachs will win him the prize, and distrust that Sachs has something up his sleeve - as indeed he does, though all Beckmesser's guesses are wide of the mark. He goes off to learn the song.
Eva comes in, ostensibly to complain about her shoes. Walther is inspired by her presence to finish the song, which Sachs, putting his own feelings for Eva aside and satisfied with his matchmaking, pronounces to be a mastersong. Eva and Walther are deeply grateful to him for his help. Sachs calls David and Magdalena in to help celebrate the new song and also promotes David to the status of journeyman, which means that he and Magdalena will be able to get married. They all set off for the festival.
Scene 2: The festival meadow
The apprentices of the different guilds dance and sing while waiting for the arrival of the masters. Then the proper business of the day begins: the townspeople sing an ode of praise to Sachs, who thanks them and makes the public announcement of the prize to be awarded by Pogner, exhorting those who aspire to the prize to be sure they are worthy of it in all respects.
The first competitor is Beckmesser, who makes a hopeless mess of Walther's song. In the face of general derision he defends himself by claiming that the song is by Sachs. Sachs denies this and tells them that the song is beautiful but has been ruined by Beckmesser. To prove his case he calls on the real composer to sing the song, thus giving Walther a chance to be heard - which otherwise, as an outsider, he would not have had.
With the unfair assistance of a full orchestra and chorus to back him, compared to Beckmesser's solitary lute, he sings his song, to general acclaim. Eva crowns him with the victor's garland and Pogner offers him the chain of a mastersinger. He rejects it angrily, but Sachs reproves him, telling him to honor the masters because their care has kept the art of poetry alive.