The Tragedy of Hamlet, Prince of Denmark, often shortened to Hamlet, is a tragedy written by William Shakespeare at an uncertain date between 1599 and 1602. Set in Denmark, the play dramatises the revenge Prince Hamlet is called to wreak upon his uncle, Claudius, by the ghost of Hamlet's father, King Hamlet. Claudius had murdered his own brother and seized the throne, also marrying his deceased brother's widow.
Hamlet is Shakespeare's longest play, and is considered among the most powerful and influential works of world literature, with a story capable of "seemingly endless retelling and adaptation by others". It was probably one of Shakespeare's most popular works during his lifetime, and still ranks among his most performed, topping the performance list of the Royal Shakespeare Company and its predecessors in Stratford-upon-Avon since 1879. It has inspired many other writers—from Johann Wolfgang von Goethe and Charles Dickens to James Joyce and Iris Murdoch—and has been described as "the world's most filmed story after Cinderella".
The story of Shakespeare's Hamlet was derived from the legend of Amleth, preserved by 13th-century chronicler Saxo Grammaticus in his Gesta Danorum, as subsequently retold by the 16th-century scholar François de Belleforest. Shakespeare may also have drawn on an earlier Elizabethan play known today as the Ur-Hamlet, though some scholars believe he himself wrote the Ur-Hamlet, later revising it to create the version of Hamlet we now have. He almost certainly wrote his version of the title role for his fellow actor, Richard Burbage, the leading tragedian of Shakespeare's time. In the 400 years since its inception, the role has been performed by numerous highly acclaimed actors in each successive century.
Three different early versions of the play are extant: the First Quarto (Q1, 1603); the Second Quarto (Q2, 1604); and the First Folio (F1, 1623). Each version includes lines and entire scenes missing from the others. The play's structure and depth of characterisation have inspired much critical scrutiny. One such example is the centuries-old debate about Hamlet's hesitation to kill his uncle, which some see as merely a plot device to prolong the action, but which others argue is a dramatisation of the complex philosophical and ethical issues that surround cold-blooded murder, calculated revenge, and thwarted desire. More recently, psychoanalytic critics have examined Hamlet's unconscious desires, while feminist critics have re-evaluated and attempted to rehabilitate the often maligned characters of Ophelia and Gertrude.
"Any dating of Hamlet must be tentative", cautions the New Cambridge editor, Phillip Edwards. The earliest date estimate relies on Hamlet's frequent allusions to Shakespeare's Julius Caesar, itself dated to mid-1599. The latest date estimate is based on an entry, of 26 July 1602, in the Register of the Stationers' Company, indicating that Hamlet was "latelie Acted by the Lo: Chamberleyne his servantes".
In 1598, Francis Meres published his Palladis Tamia, a survey of English literature from Chaucer to its present day, within which twelve of Shakespeare's plays are named. Hamlet is not among them, suggesting that it had not yet been written. As Hamlet was very popular, Bernard Lott, the series editor of New Swan, believes it "unlikely that he [Meres] would have overlooked ... so significant a piece".
The phrase "little eyases" in the First Folio (F1) may allude to the Children of the Chapel, whose popularity in London forced the Globe company into provincial touring. This became known as the War of the Theatres, and supports a 1601 dating. Katherine Duncan-Jones accepts a 1600–1 attribution for the date Hamlet was written, but notes that the Lord Chamberlain's Men, playing Hamlet in the 3000-capacity Globe, were unlikely to be put to any disadvantage by an audience of "barely one hundred" for the Children of the Chapel's equivalent play, Antonio's Revenge; she believes that Shakespeare, confident in the superiority of his own work, was making a playful and charitable allusion to his friend John Marston's very similar piece.
A contemporary of Shakespeare's, Gabriel Harvey, wrote a marginal note in his copy of the 1598 edition of Chaucer's works, which some scholars use as dating evidence. Harvey's note says that "the wiser sort" enjoy Hamlet, and implies that the Earl of Essex—executed in February 1601 for rebellion—was still alive. Other scholars consider this inconclusive. Edwards, for example, concludes that the "sense of time is so confused in Harvey's note that it is really of little use in trying to date Hamlet". This is because the same note also refers to Spenser and Watson as if they were still alive ("our flourishing metricians"), but also mentions "Owen's new epigrams", published in 1607.