Hamlet is a notoriously complicated play, full of subplots, and the title character's frequent musings on issues fundamental to the human condition themselves make it very difficult to reduce the play to a single theme. Some might argue that revenge, the central element to the plot, is the play's main theme. But a strong case could be made for death. From the appearance of King Hamlet's ghost to the play's bloody denouement in the duel between Hamlet and Laertes, death is literally everywhere in Hamlet. Moreover, death is addressed in different ways, particularly by Hamlet himself.
On the one hand, we find Hamlet pondering the spiritual aspects of death, wishing on the one hand that God had not outlawed suicide, and then observing that "what dreams may come/When we have shuffled off this mortal coil" are the only thing that makes life preferable to death. Later, however, we find him pondering the visceral, physical aspects of death, in his brief aside on the ways in which a beggar might go through the "guts of a king" and, most famously, in his speech on Yorick's skull:
Alas, poor Yorick! I knew him, Horatio: a fellow
of infinite jest, of most excellent fancy: he hath
borne me on his back a thousand times; and now,
how abhorred in my imagination it is!
Death comes to all of the play's major characters except Horatio, who himself expresses a wish to take his own life as he watches his friend Hamlet dying. Polonius, his son Laertes, and Ophelia all perish, as do Claudius, Gertrude, and Hamlet. Some of the characters deserve their fate, others clearly do not. Death in Hamlet makes no such distinctions. There are, of course many other themes in the play: madness, corruption, appearances and reality, sex, and man's aloneness in the universe are all prevalent. But death has as strong a claim as any to be judged the main theme of the play.