The play concerns the misadventures and musings of Rosencrantz and Guildenstern, two minor characters from William Shakespeare's Hamlet who are childhood friends of the prince, focusing on their actions with the events of Hamlet as background. Rosencrantz and Guildenstern Are Dead is structured as the inverse of Hamlet; the title characters are the leads, not supporting players, and Hamlet himself has only a small part. The duo appears on stage here when they are off-stage in Shakespeare's play, with the exception of a few short scenes in which the dramatic events of both plays coincide. In Hamlet, Rosencrantz and Guildenstern are used by the King in an attempt to discover Hamlet's motives and to plot against him. Hamlet, however, mocks them derisively and outwits them, so that they, rather than he, are executed in the end. Thus, from Rosencrantz's and Guildenstern's perspective, the action in Hamlet is largely nonsensical and comical.
After the two characters witness a performance of The Murder of Gonzago—the story within a story in the play Hamlet—they find themselves on a boat taking Prince Hamlet to England with the troupe that staged the performance. They are intended to give the English king a message telling him to kill Hamlet. Instead, Hamlet discovers this and switches the letter for another, telling the king to kill Rosencrantz and Guildenstern. During the voyage, the two are ambushed by pirates and lose their prisoner, Hamlet, before resigning themselves to their fate and presumably dying thereafter.