Hamlet, in full Hamlet, Prince of Denmark, tragedy in five acts by William Shakespeare, written about 1599–1601 and published in a quarto edition in 1603 from an unauthorized text, with reference to an earlier play. The First Folio version was taken from a second quarto of 1604 that was based on Shakespeare’s own papers with some annotations by the bookkeeper. Shakespeare’s telling of the story of Prince Hamlet was derived from several sources, notably from Books III and IV of Saxo Grammaticus’s 12th-century Gesta Danorum and from volume 5 (1570) of Histoires tragiques, a free translation of Saxo by François