The play opens on a dark night at Elsinore Castle in Denmark. A couple of guards discuss an unsettling recent phenomenon: a ghost resembling Denmark’s newly deceased king has been regularly appearing outside the castle at night. Convinced that the appearance of a ghost means evil is afoot, the guards resolve to tell the late king’s son, Prince Hamlet, about the ghost of his father. Prince Hamlet has returned from his studies in Germany to attend his father’s funeral and to witness his mother’s remarriage to his uncle, Claudius, who has now assumed the throne. In addition to the recent upheavals within the royal family, Denmark is under threat from Fortinbras, the son of the late king of Norway. Unbeknownst to his uncle (the current king of Norway), young Fortinbras has been gathering troops to attack Denmark and reclaim the lands his father once lost.
One night, the ghost of the late king appears to Hamlet and reveals that his seemingly accidental death was actually a murder. The ghost tells him that the murderer was none other than Claudius, the king’s brother and Hamlet’s uncle. Disgusted by the thought that Claudius murdered his own brother before stealing his wife and his throne, Hamlet vows revenge. He decides to feign madness in order to investigate the matter further. Hamlet begins to act erratically, even toward Ophelia, a beautiful young noblewoman and the object of Hamlet’s affection. Ophelia’s father, Polonius, and her brother, Laertes, warn her to stay away from Hamlet, though Polonius believes that Hamlet’s recent madness must stem from his love for Ophelia.
Wanting to uncover the cause of Hamlet’s strange behavior, King Claudius and Queen Gertrude summon Rosencrantz and Guildenstern, Hamlet’s old school friends, to court. At Polonius’s suggestion, he and Claudius eavesdrop on a conversation between Hamlet and Ophelia to ascertain whether it is love that has altered Hamlet’s mental state. When this encounter proves inconclusive, Claudius decides to send Hamlet on a trip to England, and Polonius suggests that he attempt to eavesdrop yet again—this time on a conversation between Hamlet and his mother, Queen Gertrude. Meanwhile, inspired by the arrival of an acting troupe, Hamlet decides to have them perform a play that will mimic his father’s murder. Hamlet closely watches Claudius during the murder scene, and he interprets Claudius’s suspicious reaction as a confirmation of his guilt. After the play, Hamlet spies Claudius at prayer and realizes that this would be the perfect time to enact his revenge and kill him. However, he reasons that it would be too lenient to allow Claudius to go to heaven cleansed of his sins and decides that he should wait to act.
As Hamlet goes to meet his mother in her chambers, Polonius conceals himself behind a tapestry to listen in on their conversation. When Hamlet hears someone behind the tapestry, he thrusts his sword through it, killing Polonius. Desperate to maintain order, Claudius decides to send Hamlet (accompanied by Rosencrantz and Guildenstern) to England at once. In secret, Claudius drafts a letter to England, instructing that Hamlet be killed immediately upon arrival. Ophelia is driven mad by the loss of her father and ultimately drowns after falling into a brook. En route to England, Hamlet discovers Claudius’s treacherous plot and manages to return to Denmark. Enraged by the untimely deaths of his father and sister, young Laertes returns to court, and Claudius persuades Laertes to help get rid of Hamlet once and for all.
When Hamlet returns to Elsinore, Claudius arranges a public fencing match between Hamlet and Laertes. Unbeknownst to Hamlet, Laertes’s fencing sword has been secretly sharpened and poisoned, ensuring that even the smallest nick will kill Hamlet. As a backup plan, Claudius has also poisoned a cup of wine to offer Hamlet should Laertes fail to wound him. During the duel, Gertrude accidentally drinks the poisoned wine intended for Hamlet. Laertes wounds Hamlet with the poisoned sword and is, in turn, wounded with it himself in the ensuing scuffle. When Gertrude suddenly drops dead from the poison, Laertes admits his and Claudius’s treacherous plot to Hamlet. Enraged, Hamlet kills Claudius by stabbing him with the poisoned sword and forcing him to drink the remaining poisoned wine. Laertes dies after asking for Hamlet’s forgiveness. Beginning to succumb to the poison himself, Hamlet begs his friend Horatio to live and tell the world what has happened here. As young Fortinbras’s troops approach the castle, Hamlet says that Fortinbras should be made king. Hamlet dies just before Fortinbras enters the room, which is now littered with the bodies of the royal family. Horatio promises to explain the events that have led to this tragedy, and Fortinbras orders that Hamlet’s body be carried away with dignity.