When Measure for Measure was originally published in the First Folio of Shakespeare's plays in 1623, it was categorized as a comedy. Most agree that this identification still stands today, and that the play relies most heavily on comic tropes like irony, disguise as a plot device, and moments of comic relief. However, among all of Shakespeare's comedies, Measure for Measure is certainly not the most lighthearted. Indeed, alongside its comedic elements are also conventions most readily associated with early modern tragedy: lengthy soliloquies, meditations on death, and the threat of execution all linger throughout the play, lending it a generally darker tone than most Renaissance comedies and Shakespeare's comic repertoire in particular.
Indeed, many agree that Claudio's speech in Act Three about the myriad manifestations of death is a precursor to Hamlet's "To be or not to be" speech in what is now Shakespeare's most famous tragedy. In the speech, Claudio debates whether the uncertainty of death is preferable to a life of suffering (due to the fact that he is about to executed for fornication). The sentiments expressed in Claudio's speech are almost identical to those in Hamlet's, and some critics have even argued that the speech is the most eloquent soliloquy in all of Shakespeare's plays.
Still, these tragic elements are only peppered throughout Measure for Measure, with comic elements playing a much more significant role. The play also features an early use of the deus ex machina conclusion, or a resolution spurred by an unlikely occurrence – in this case, the revelation that the friar is actually a disguised Duke Vincentio. The use of the deus ex machina plot device is generally considered an element of tragicomedy or dark comedies, which tend to require more thorough resolutions than traditional comedies. Thus, one could certainly label Measure for Measure a dark comedy among Shakespeare's repertoire.