The phrase “open sesame” is widely known to speakers across many languages as a way to bring about a desired end without fail. It comes from the story of Ali Baba and the Forty Thieves, and while this story is widely attributed to A Thousand and One Nights, a collection of ancient Arabic stories, the origins of the phrase “open sesame” are far more recent.

The phrase was first written down in French, in volume 11 of Les mille et une nuits, contes arabes traduits en français, published in 1717. The author, Antoine Galland, had begun translating Arabic and Indian stories into French in 1707. The stories proved extremely popular and he continued publishing new volumes of tales, many of which were told to him orally. Galland had heard the story of Ali Baba from a Syrian storyteller and added it to his ongoing publication of A Thousand and One Nights, though it was published posthumously.
In Galland’s version of the story, Ali Baba overhears thieves using the magic words “sésame, ouvre-toi” to open a cave of riches. These stories were so popular that the phrase swiftly crept into common use as a way to mark actions that would enact a desired result. By as early as 1764, “open sesame” had even become a noun that could be counted.

Though the story is Arabic in origin, the phrase “open sesame” is an English translation of a French construction. The word “sesame” may feel suitably Middle Eastern, but there is no etymological history to Arabic and Antoine Galland left no explanation for the phrase. Several etymologies have been proposed, but it is likely the truth of the matter will never be known.