Macbeth, tragedy in five acts by William Shakespeare, written sometime in 1606–07 and published in the First Folio of 1623.