Dancing Men Cipher
Encode and decode messages using the Sherlock Holmes stick-figure alphabet. Flags mark word boundaries.
How to Use the Dancing Men Cipher Tool
- Encode mode — type any text in the input box. Each letter becomes an SVG stick figure. The last figure of each word gets a flag.
- Decode mode — enter letter codes separated by spaces. Use
/for word boundaries. The tool reconstructs the original message. - Reference tab — view the complete 26-letter alphabet with each pose labelled.
About the Dancing Men Cipher
The Dancing Men cipher first appeared in Arthur Conan Doyle's short story "The Adventure of the Dancing Men," published in The Strand Magazine in December 1903. In the story, a Norfolk squire named Hilton Cubitt receives a series of notes covered with stick figures that appear to be dancing. He initially dismisses them as a child's game, but Sherlock Holmes recognises the figures as a sophisticated cipher used by the American criminal Black Abe Slaney.
Holmes decodes the cipher through frequency analysis — counting how often each figure appears and matching the most common figure to the letter E, the most frequent letter in English text. Working outward from this anchor, he reconstructs the full alphabet. This demonstration of frequency analysis was one of the earliest clear explanations of cryptanalysis in popular fiction, and it remains one of the most memorable code-breaking scenes in detective literature.
How the Cipher Works
The Dancing Men cipher is a monoalphabetic substitution cipher. Every letter of the alphabet is replaced by a unique stick-figure image. The figures are drawn as simple line-figure humans in various arm and leg positions. The key innovation that separates it from purely written substitution ciphers is the use of a flag: the last figure in each word is drawn holding a small pennant or flag in one raised hand. This allows a reader to separate words without using visible spaces, which would make the message obviously language-based to a casual observer.
Security Analysis
Like all monoalphabetic substitution ciphers, the Dancing Men cipher is vulnerable to frequency analysis. In any sufficiently long English text, E appears about 12.7% of the time, T about 9.1%, A about 8.2%, and so on. An analyst can count figure frequencies in a Dancing Men message and match high-frequency figures to high-frequency letters. With a message of 50+ characters, the cipher can usually be broken without the key. For this reason, it is considered a weak cipher by modern cryptographic standards.
Using Stick Figures in Steganography
The visual disguise of the Dancing Men cipher is its most clever feature. A line of dancing stick figures looks like playful doodles or folk art to an uninformed observer. This is a form of steganography — hiding the existence of a message rather than just its content. Modern steganography techniques hide data in image pixels, audio files, or HTML whitespace, but the principle is the same: if a secret observer does not know a message exists, they cannot attempt to decode it.
Related Ciphers
Other visual substitution ciphers include Pigpen (geometric shapes), Templar cipher (a variant of Pigpen), and Alien Alphabet ciphers used in TV shows and games. All share the same monoalphabetic substitution structure and the same vulnerability to frequency analysis. Explore our Pig Latin Translator, A1Z26 Cipher, or Scytale Cipher for more classic codes.