The main source of Rosencrantz and Guildenstern Are Dead is Shakespeare's Hamlet. Comparisons have also been drawn with Samuel Beckett's Waiting for Godot, for the presence of two central characters who almost appear to be two halves of a single character. Many plot features are similar as well: the characters pass time by playing Questions, impersonating other characters, and interrupting each other or remaining silent for long periods of time.
The title is taken directly from the final scene of Shakespeare's Hamlet. In earlier scenes, Prince Hamlet, having been exiled to England by the treacherous King of Denmark (his uncle, who murdered Hamlet's father to obtain the throne) discovered en route a letter from the King carried by his old but now untrusted friends Rosencrantz and Guildenstern. The letter commanded Hamlet's death upon his arrival in England. Hamlet rewrote the letter to command Rosencrantz and Guildenstern's death and escaped back to Denmark. By the end of Shakespeare's play, Prince Hamlet, Laertes, Ophelia, Polonius, King Claudius and Gertrude all lie dead. An ambassador from England arrives to bluntly report "Rosencrantz and Guildenstern are dead" (Hamlet. Act V, Scene II, line 411) and so they join all the stabbed, poisoned, and drowned key characters. By the end of Hamlet, Horatio is the only main figure left alive.