Prince Hamlet's father has recently died, leaving his brother, Claudius, to take the throne after a very short courtship with Hamlet's widow, Gertrude, whom he has now married. He inherits a country that is perpetually near war with neighboring Norway; King Hamlet had killed King Fortinbras in a battle some years previously and his sickly brother inherited the throne, but his poor health is no comfort to the Danes who still fear that an invasion may occur any moment.
Prince Hamlet's friend, Horatio, is summoned to the castle by two sentries who are certain that they have seen King Hamlet's ghost. They want to ask Horatio if he sees him too and when he does it is decided that he should talk to the Prince about it. Prince Hamlet is very depressed because he is missing his father and because his mother fails to stand up for him when he is bullied by his uncle, who tells him he should not be grieving any longer, and also forbids him returning to school in Wittenberg, despite having just given permission for his adviser, Polonius, to send his son Laertes back to France to continue his education. When Horatio tells him that he and the sentries have seen his father's ghost he determines to see this for himself.
Laertes' sister Ophelia is romantically interested in Hamlet but her family do not approve. Polonius orders her to reject any romantic overtures but the last thing on Hamlet's mind is romance; he is seeking his father's ghost which appears to him on the castle ramparts. King Hamlet's ghost tells his son that he did not die naturally but that Claudius killed him. He wants Hamlet to avenge his murder, and when Hamlet agrees the ghost disappears. He tells Horatio and the sentries what has happened and informs them of his plan to pretend that he is going mad.
When he goes to Ophelia's door behaving like a madman, Ophelia tells Polonius at once. Polonius believes he is out of his mind with love and decides to tell Gertrude and Claudius. The King and Queen decide to ask two friends of Hamlet, Rosencrantz and Guildenstern, to get to the bottom of his erratic behavior. Polonius also tries to find out what is ailing the prince. It does not take long for Hamlet to realize that his two visiting friends are now spying on him for Claudius. He is cagey with his answers and admits only that he is unhappy with his current situation. When he learns that his friends have brought a troop of actors with them he requests that they perform the soliloquy about the death of King Priam and Queen Hecuba from a play about the Trojan War. Their performance is very good and this inspires Hamlet to plan to stage The Murder of Gonzaga which features a death very similar to his father's. He will then be able to discern whether or not the ghost is being entirely truthful and also judge Claudius' guilt or innocence based on his reaction to the play.
Polonius orders Ophelia to give all of Hamlet's love notes and gifts back, and they watch whilst she does so to try to gauge his reaction. Hamlet is clearly hurt but thy cannot decide if his reaction is emotional distress or madness. Claudius, though, sees that he is not mad because of love. The Court convenes to watch The Murder of Gonzaga which concludes with the Player King killed by having poison poured into his ear. Claudius is clearly disquieted and runs from the room which is all the proof of guilt that Hamlet needs.
Gertrude is furious with him and demands an explanation; Claudius, meanwhile, is becoming slightly deranged himself, muttering that repentance would be futile because everything he has is ill gotten gains from the murder of his brother. The meeting between Gertrude and Hamlet becomes heated very quickly and Gertrude believes he may become violent, calling for help. Polonius has been spying on them from behind a large tapestry, tries to go to her aid but in his blind rage Hamlet believes it is Claudius, not Polonius, who is trying to restrain him, and stabs at him, killing him. As Hamlet is berating his mother for being unable to see Claudius for the person he really is, his father's ghost appears to him again to chastise him for speaking to her that way and for doing nothing himself to avenge the murder. Since Gertrude cannot see the ghost she believes that Hamlet is talking to himself and this is further proof that he has completely lost his mind.
Hamlet taunts Claudius about the location of Polonius' body which Claudius takes as a threat. He sends Hamlet to England and sends a letter to the English King asking for him to execute Hamlet immediately. Ophelia has become mad herself after her father's death, and upon his return from France, Laertes finds himself less grief-stricken and more enraged about the wrongs that have been done to his family. Claudius lays the blame for everything at Hamlet's feet and reassures him that he will be executed shortly, but he later learns via a letter that Hamlet foiled Claudius' plan and has returned to Denmark. He negotiated his escape with a group of pirates who were trying to attack his ship as it headed for England. Claudius suggests a duel between Hamlet and Laertes, giving Laertes a foil with a poisoned tip. If he is not the victor of the duel, then Claudius will hand him a glass of wine that he will have poisoned.
Hamlet is busy catching Horatio up with everything that happened en route to England, when they are interrupted by a courtier who brings Hamlet the challenge of a fencing match. Horatio begs him to turn it down but Hamlet accepts. He does very well, and pulls out to an early lead of two hits. Gertrude is proud of him and raises a glass to his performance, but she drinks the wine with the poison in it. Laertes notices this and realizes that their plot will be revealed so he slashes his foil at Hamlet. There is a scuffle and they somehow switch foils. Laertes is poisoned with his own weapon. As he lays dying he confesses that Claudius set up everything and he makes his peace with Hamlet. Hamlet kills Claudius too. He is dying himself as well and names Horatio his successor. Horatio does not want to be the last man standing but Hamlet begs him, dying in his arms. King Fortinbras of Norway, arriving at the castle en route to Poland with his troops, sees that the entire Danish royal family is dead, and takes the crown for himself. He also instructs that Hamlet be given a funeral with full military honors, as befits a man of his courage and valor.