The main frame story concerns Shahryār (Arabic: شهريار, from Middle Persian šahr-dār, lit. "holder of realm"), whom the narrator calls a "Sasanian king" ruling in "India and China". Shahryār is shocked to learn that his brother's wife is unfaithful; discovering that his own wife's infidelity has been even more flagrant, he has her killed. In his bitterness and grief, he decides that all women are the same. Shahryār begins to marry a succession of virgins only to execute each one the next morning, before she has a chance to dishonor him. Eventually the vizier, whose duty it is to provide them, cannot find any more virgins. Scheherazade (Persian/ Farsi: شهْرزاد Shahrazād, from Middle Persian čehr شهر, "lineage" + āzād ازاد, "noble"), the vizier's daughter, offers herself as the next bride and her father reluctantly agrees. On the night of their marriage, Scheherazade begins to tell the king a tale, but does not end it. The king, curious about how the story ends, is thus forced to postpone her execution in order to hear the conclusion. The next night, as soon as she finishes the tale, she begins another one, and the king, eager to hear the conclusion of that tale as well, postpones her execution once again. This goes on for one thousand and one nights, hence the name.
The tales vary widely: they include historical tales, love stories, tragedies, comedies, poems, burlesques, and various forms of erotica. Numerous stories depict jinns, ghouls, apes, sorcerers, magicians, and legendary places, which are often intermingled with real people and geography, not always rationally. Common protagonists include the historical Abbasid caliph Harun al-Rashid, his Grand Vizier, Jafar al-Barmaki, and the famous poet Abu Nuwas, despite the fact that these figures lived some 200 years after the fall of the Sassanid Empire, in which the frame tale of Scheherazade is set. Sometimes a character in Scheherazade's tale will begin telling other characters a story of his own, and that story may have another one told within it, resulting in a richly layered narrative texture.
The different versions have different individually detailed endings (in some Scheherazade asks for a pardon, in some the king sees their children and decides not to execute his wife, in some other things happen that make the king distracted) but they all end with the king giving his wife a pardon and sparing her life.
The narrator's standards for what constitutes a cliffhanger seem broader than in modern literature. While in many cases a story is cut off with the hero in danger of losing his life or another kind of deep trouble, in some parts of the full text Scheherazade stops her narration in the middle of an exposition of abstract philosophical principles or complex points of Islamic philosophy, and in one case during a detailed description of human anatomy according to Galen—and in all these cases turns out to be justified in her belief that the king's curiosity about the sequel would buy her another day of life.