Peer Gynt is the son of the once highly regarded Jon Gynt. Jon Gynt spent all his money on feasting and living lavishly, and had to go from his farm as a wandering salesman, leaving his wife and son behind in debt.Åse, the mother, wished to raise her son to restore the lost fortune of his father, but Peer is soon to be considered useless. He is a poet and a braggart, not unlike the youngest son from Norwegian fairy tales, the "Ash Lad", with whom he shares some characteristics.
As the play opens, Peer gives an account of a reindeer hunt that went awry, a famous theatrical scene generally known as "the Buckride". His mother scorns him for his vivid imagination, and taunts him because he spoiled his chances with Ingrid, the daughter of the richest farmer. Peer leaves for Ingrid's wedding, scheduled for the following day, because he may still get a chance with the bride. His mother follows quickly to stop him from shaming himself completely.
At the wedding, the other guests taunt and laugh at Peer, especially the local blacksmith, Aslak, who holds a grudge after an earlier brawl. In the same wedding, Peer meets a family of Haugean newcomers from another valley. He instantly notices the elder daughter, Solveig, and asks her to dance. She refuses because her father would disapprove, and because Peer's reputation has preceded him. She leaves, and Peer starts drinking. When he hears the bride has locked herself in, he seizes the opportunity, runs away with her, and spends the night with her in the mountains.
Peer is banished for kidnapping Ingrid. As he wanders the mountains, his mother,Åse, and Solveig's father search for him. Peer meets three amorous dairymaids who are waiting to be courted by trolls (a folklore motif from Gudbrandsdalen). He becomes highly intoxicated with them and spends the next day alone suffering from a hangover. He runs head-first into a rock and swoons, and the rest of the second act probably takes place in Peer's dreams.
He comes across a woman clad in green, who claims to be the daughter of the troll mountain king. Together they ride into the mountain hall, and the troll king gives Peer the opportunity to become a troll if Peer would marry his daughter. Peer agrees to a number of conditions, but declines in the end. He is then confronted with the fact that the green-clad woman is with child. Peer denies this; he claims not to have touched her, but the wise troll king replies that he begat the child in his head. Crucial for the plot and understanding of the play is the question asked by the troll king: What is the difference between troll and man?
The answer given by the Old Man of the Mountain is: "Out there, where sky shines, humans say: 'To thyself be true.' In here, trolls say: 'Be true to yourself and to hell with the world.'" Egoism is a typical trait of the trolls in this play. From then on, Peer uses this as his motto, always proclaiming that he is himself, whatever that is. He then meets one of the most interesting characters, the Bøyg — a creature who has no real description. Asked the question "Who are you?" The Bøyg answers, "Myself". In time, Peer also takes the Bøyg's important saying as a motto: "Go around". The rest of his life, he "beats around the bush" instead of facing himself or the truth.
Upon awaking, Peer is confronted by Helga, Solveig's sister, who gives him food and regards from her sister. Peer gives the girl a silver button for Solveig to keep and asks that she not forget him.
As an outlaw, Peer struggles to build his own cottage in the hills. Solveig turns up and insists on living with him. She has made her choice, she says, and there will be no return for her. Peer is delighted and welcomes her, but as she enters the cabin, an elderly-appearing woman in green garments appears with a limping boy at her side.
This is the green-clad woman from the mountain hall, and her half-human brat is the child begotten by Peer from his mind during his stay there. She has cursed Peer by forcing him to remember her and all his previous sins, when facing Solveig. Peer hears a ghostly voice saying, "Go roundabout, Peer", and decides to leave. He tells Solveig he has something heavy to fetch. He returns in time for his mother's death, and then sets off overseas.
Peer is away for many years, taking part in various occupations and playing various roles including that of a businessman engaged in enterprises on the coast of Morocco. Here, he explains his view of life, and we learn that he is a businessman taking part in unethical transactions, including sending heathen images to China and trading slaves. In his defense, he points out that he has also sent missionaries to China, and he treated his slaves well.
His companions rob him, after he decides to support the Turks in suppressing a Greek revolt, and leave him alone on the shore. He then finds some stolen Bedouin gear, and, in these clothes, he is hailed as a prophet by a local tribe. He tries to seduce Anitra, the chieftain's daughter, but she steals his money and rings, gets away, and leaves him.
Then he decides to become a historian and travels to Egypt. He wanders through the desert, passing the Colossi of Memnon and the Sphinx. As he addresses the Sphinx, believing it to be the Bøyg, he encounters the keeper of the local madhouse, himself insane, who regards Peer as the bringer of supreme wisdom. Peer comes to the madhouse and understands that all of the patients live in their own worlds, being themselves to such a degree that no one cares for anyone else. In his youth, Peer had dreamt of becoming an emperor. In this place, he is finally hailed as one — the emperor of the "self". Peer despairs and calls for the "Keeper of all fools", i.e., God.
Finally, on his way home as an old man, he is shipwrecked. Among those on board, he meets the Strange Passenger, who wants to make use of Peer's corpse to find out where dreams have their origin. This passenger scares Peer out of his wits. Peer lands on shore bereft of all of his possessions, a pitiful and grumpy old man.
Back home in Norway, Peer Gynt attends a peasant funeral and an auction, where he offers for sale everything from his earlier life. The auction takes place at the very farm where the wedding once was held. Peer stumbles along and is confronted with all that he did not do, his unsung songs, his unmade works, his unwept tears, and his questions that were never asked. His mother comes back and claims that her deathbed went awry; he did not lead her to heaven with his ramblings.
Peer escapes and is confronted with the Button-molder, who maintains that Peer's soul must be melted down with other faulty goods unless he can explain when and where in life he has been "himself". Peer protests. He has been only that, and nothing else. Then he meets the troll king, who states that Peer has been a troll, not a man, most of his life.
The Button-molder comes along and says that he has to come up with something if he is not to be melted down. Peer looks for a priest to whom to confess his sins, and a character named "The Lean One" (who is the Devil) turns up. The Lean One believes Peer cannot be counted a real sinner who can be sent to Hell; he has committed no grave sin.
Peer despairs in the end, understanding that his life is forfeit; he is nothing. But at the same moment, Solveig starts to sing— the cabin Peer built is close at hand, but he dares not enter. The Bøyg in Peer tells him "go around". The Button-molder shows up and demands a list of sins, but Peer has none to give, unless Solveig can vouch for him. Then Peer breaks through to Solveig, asking her to forgive his sins. But sheanswers: "You have not sinned at all, my dearest boy."
Peer does not understand— he believes himself lost. Then he asks her: "Where has Peer Gynt been since we last met? Where was I as the one I should have been, whole and true, with the mark of God on my brow?" She answers; "In my faith, in my hope, in my love." Peer screams, calls his mother, and hides himself in her lap.Solveig sings her lullaby for him, and we might presume he dies in this last scene of the play, although there are neither stage directions nor dialogue to indicate that he actually does.
Behind the corner, the Button-molder, who is sent by God, still waits, with the words: "Peer, we shall meet at the last crossroads, and then we shall see if... I'll say no more."