Hamlet is the son of the late King Hamlet (of Denmark), who died two months before the start of the play. After King Hamlet's death, his brother, Claudius, becomes king, and marries King Hamlet's widow, Gertrude (Queen of Denmark). Young Hamlet fears that Claudius killed his own brother (Hamlet's father) to become king of Denmark, greatly angering Hamlet. Two officers, Marcellus and Barnardo, summon Hamlet's friend Horatio, and later Hamlet himself to see the late King Hamlet's ghost appear at midnight. The ghost tells Hamlet privately that Claudius had indeed murdered King Hamlet by pouring poison in his ear. Hamlet is further enraged and plots of how to revenge his father's death.
In his anger, Hamlet seems to act like a madman, prompting King Claudius, his wife Gertrude, and his advisor Polonius to send Rosencrantz and Guildenstern to spy on Hamlet and figure out why he is acting mad. Hamlet even treats Polonius' daughter Ophelia rudely, prompting Polonius to believe Hamlet is madly in love with her, though Claudius expects otherwise. Polonius, a man who talks too long- windedly, had allowed his son Laertes to go to France (then sent Reynaldo to spy on Laertes) and had ordered Ophelia not to associate with Hamlet. Claudius, fearing Hamlet may try to kill him, sends Hamlet to England. Before leaving, however, Hamlet convinces an acting company to reenact King Hamlet's death before Claudius, in the hopes of causing Claudius to break down and admit to murdering King Hamlet. Though Claudius is enraged, he does not admit to murder. Hamlet's mother tries to reason with Hamlet after the play, while Polonius spied on them from behind a curtain. Hamlet hears Polonius, and kills him through the curtain, thinking the person is Claudius. When finding out the truth, Hamlet regrets the death, yet Claudius still sends him to England, accompanied by Rosencrantz and Guildenstern with orders from Claudius that the English kill Hamlet as soon as her arrives.
After Hamlet leaves, Laertes returns from France, enraged over Polonius' death. Ophelia reacts to her father's death with utter madness and eventually falls in a stream and drowns, further angering Laertes. En route to England, Hamlet finds the orders and changes them to order Rosencrantz and Guildenstern killed, as does occur, though Hamlet is kidnapped by pirates one day later. The pirates return Hamlet to Claudius (for a ransom), and Claudius tries one last attempt to eliminate Hamlet: he arranges a sword duel between Laertes and Hamlet. The trick, however, is that the tip of Laertes' sword is poisoned. As a backup precaution, Claudius poisons the victory cup in case Hamlet wins. During the fight, the poisoned drink is offered to Hamlet, he declines, and instead his mother, Gertrude, drinks it (to the objection of Claudius). Laertes, losing to Hamlet, illegally scratches him with the poisoned sword to ensure Hamlet's death. Hamlet (unknowingly), then switches swords with Laertes, and cuts and poisons him. The queen dies, screaming that she has been poisoned and Laertes, dying, admits of Claudius' treachery. Weakening, Hamlet fatally stabs Claudius, Laertes dies, and Hamlet begins his death speech. Though Horatio wants to commit suicide out of sorrow, Hamlet entreats him to tell the story of King Hamlet's death and Rosencrantz and Guildenstern's deaths to all. Fortinbras, the prince of Norway, arrives from conquest of England, and Hamlet's last dying wish is that Fortinbras become the new King of Denmark, as happens.