Three early editions of the text have survived, making attempts to establish a single "authentic" text problematic. Each is different from the others:
- First Quarto (Q1) In 1603 the booksellers Nicholas Ling and John Trundell published, and Valentine Simmes printed the so-called "bad" first quarto. Q1 contains just over half of the text of the later second quarto.
- Second Quarto (Q2) In 1604 Nicholas Ling published, and James Roberts printed, the second quarto. Some copies are dated 1605, which may indicate a second impression; consequently, Q2 is often dated "1604/5". Q2 is the longest early edition, although it omits about 77 lines found in F1 (most likely to avoid offending James I's queen, Anne of Denmark).
- First Folio (F1) In 1623 Edward Blount and William and Isaac Jaggard published the First Folio, the first edition of Shakespeare's Complete Works.
Other folios and quartos were subsequently published—including John Smethwick's Q3, Q4, and Q5 (1611–37)—but these are regarded as derivatives of the first three editions.
Early editors of Shakespeare's works, beginning with Nicholas Rowe (1709) and Lewis Theobald (1733), combined material from the two earliest sources of Hamlet available at the time, Q2 and F1. Each text contains material that the other lacks, with many minor differences in wording: scarcely 200 lines are identical in the two. Editors have combined them in an effort to create one "inclusive" text that reflects an imagined "ideal" of Shakespeare's original. Theobald's version became standard for a long time, and his "full text" approach continues to influence editorial practice to the present day. Some contemporary scholarship, however, discounts this approach, instead considering "an authentic Hamlet an unrealisable ideal. ... there are texts of this play but no text". The 2006 publication by Arden Shakespeare of different Hamlet texts in different volumes is perhaps the best evidence of this shifting focus and emphasis.
Traditionally, editors of Shakespeare's plays have divided them into five acts. None of the early texts of Hamlet, however, were arranged this way, and the play's division into acts and scenes derives from a 1676 quarto. Modern editors generally follow this traditional division, but consider it unsatisfactory; for example, after Hamlet drags Polonius's body out of Gertrude's bedchamber, there is an act-break after which the action appears to continue uninterrupted.
The discovery in 1823 of Q1—whose existence had been quite unsuspected—caused considerable interest and excitement, raising many questions of editorial practice and interpretation. Scholars immediately identified apparent deficiencies in Q1, which was instrumental in the development of the concept of a Shakespearean "bad quarto". Yet Q1 has value: it contains stage directions that reveal actual stage practices in a way that Q2 and F1 do not; it contains an entire scene (usually labelled 4.6) that does not appear in either Q2 or F1; and it is useful for comparison with the later editions. The scene order is more coherent, without the problems of Q2 and F1 of Hamlet seeming to resolve something in one scene and enter the next drowning in indecision. The major deficiency of Q1 is in the language: particularly noticeable in the opening lines of the famous "To be, or not to be" soliloquy: "To be, or not to be, aye there's the point. / To die, to sleep, is that all? Aye all: / No, to sleep, to dream, aye marry there it goes."
Q1 is considerably shorter than Q2 or F1 and may be a memorial reconstruction of the play as Shakespeare's company performed it, by an actor who played a minor role (most likely Marcellus). Scholars disagree whether the reconstruction was pirated or authorised. Another theory, considered by New Cambridge editor Kathleen Irace, holds that Q1 is an abridged version intended especially for travelling productions. The idea that Q1 is not riddled with error but is instead eminently fit for the stage has led to at least 28 different Q1 productions since 1881.