Tool to decrypt/encrypt according to Mary, Queen of Scots. Mary Stuart code is a substitution cryptogram by symbols extended to the words used by the Queen of Scots.
Mary Stuart Code - dCode
Tag(s) : Symbol Substitution
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Mary Stuart (1542-1587), Queen of Scots, spent nearly twenty years captive in England. During her captivity, she continued to correspond with her allies. To protect her secrets from the spies of Elizabeth I, she used entirely encrypted letters. The entire collection of coded/encrypted correspondence constitutes a corpus of several dozen letters, some of which have historical value.
The cipher developed by Mary Stuart primarily used homophonic ciphers. This meant that multiple symbols could represent the same letter. Throughout the correspondence, there are 219 distinct symbols, as well as a system of diacritics (dots, dashes) to distinguish variants of a symbol. Some symbols represented entire words, proper nouns, or frequently occurring syllables, or even instructions to delete or repeat a letter.
The complete alphabet (also called the nomenclator) was regularly changed but kept secret between her and her correspondents.
The most famous alphabet is the one used in the Babington Plot, led by Sir Anthony Babington, which aimed to kill Queen Elizabeth I so that Mary Stuart could take the throne. This is the alphabet proposed on this page:
The alphabet contains 5 blank characters that can be used as decoys or word separators (which complicates frequency analysis).
Mary Stuart (or Mary I of Scotland) was born December 8, 1542 (and died February 8, 1587) was the Queen of Scotland from 1542 to 1567 and Queen consort of France between 1559 and 1560.
She was convicted of conspiring to assassinate the Queen of England during the Babington plot.
A book is dedicated to her and her code here (affiliate link)
While some correspondence was decoded using discovered or intercepted nomenclators, several dozen letters remained illegible for nearly 500 years.
In 2023, three researchers transcribed the symbols using computer tools and then applied cryptological analysis. They identified plausible sequences in French and gradually reconstructed the correspondences. Plaintext copies found in English archives confirmed the correspondences.
The corpus used covers missives from the period 1578–1584, representing approximately 50,000 words. In it, Mary discusses her captivity, her diplomatic strategies, her support for the marriage between the Duke of Anjou and Elizabeth I, her complaints against the Earl of Leicester, and her hopes for an alliance with Spain. They also reveal her efforts to maintain a secret network of communications.
More information in the scientific article here
dCode retains ownership of the "Mary Stuart Code" source code. Any algorithm for the "Mary Stuart Code" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Mary Stuart Code" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Mary Stuart Code" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Mary Stuart Code" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Mary Stuart Code on dCode.fr [online website], retrieved on 2025-10-17,