Dancing Men Cipher (Sherlock Holmes)

Conan Doyle's stick-figure cipher as Unicode approximation

Free Dancing Men cipher tool — encode and decode text using a consistent stick-figure substitution inspired by the Sherlock Holmes story, with flag-bearing figures marking word ends. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the Dancing Men cipher?

It is a substitution cipher from the Sherlock Holmes story The Adventure of the Dancing Men, where each letter of the alphabet is drawn as a little stick figure in a different pose, and a flag held by a figure marks the end of a word.

The Dancing Men cipher comes from Arthur Conan Doyle’s Sherlock Holmes tale The Adventure of the Dancing Men, in which a series of stick-figure drawings turns out to be a hidden message. Because the original figures are hand-drawn art, this tool uses a consistent Unicode stand-in: a fixed, reversible glyph for each letter, plus a flag marker for word ends. Everything runs in your browser.

How it works

Each of the 26 letters maps to one distinct glyph. The mapping is one-to-one and fixed, so encoding then decoding always round-trips back to the original text. As in the story, the last figure of each word carries a flag — here represented by an appended flag marker — so spaces are preserved through the cipher.

Decoding simply reverses the lookup: strip any flag marker, find the letter whose glyph matches, and rebuild the words. Characters with no mapping (digits, punctuation) pass through unchanged.

Tips and example

Holmes cracked the real cipher with frequency analysis — the single most common figure was almost certainly the letter E, and short, frequently repeated figure groups suggested common short words. The same logic applies to any simple substitution cipher.

To try it, type a phrase and switch to Encode; you will get a row of figures with flags at word ends. Paste those figures back with Decode selected to recover the text. This is a puzzle and storytelling tool, not real encryption — a substitution cipher offers no protection against analysis.

The story behind the cipher

Arthur Conan Doyle published The Adventure of the Dancing Men in 1903. In the story, a man receives a series of messages drawn as rows of stick figures in different poses, which he initially dismisses as a child’s prank. Sherlock Holmes recognises it as a cipher, applies frequency analysis, and decodes it — saving a life in the process, or so he hopes. The story illustrates a principle still central to cryptanalysis: a cipher is only as strong as the attacker’s inability to guess the mapping.

The original drawings are not perfectly consistent between the illustrations in different magazine editions, which is why there is no single “official” Dancing Men font — the poses were artistic rather than standardised. This tool chooses a consistent mapping and sticks to it, so round-tripping always works.

Frequency analysis: how Holmes broke it

A straightforward substitution cipher maps each letter to exactly one symbol. Because letter frequencies in English are well-known, an attacker counts how often each symbol appears:

  • The most common symbol is almost certainly E (the most frequent English letter).
  • Three-symbol sequences that appear often are likely THE or AND.
  • Single-symbol “words” are usually I or A.

With a short message of even a few dozen characters, frequency analysis typically recovers the key completely. This is why no simple substitution cipher is used in modern security — but it makes for a satisfying puzzle and a wonderful period piece.

Practical uses today

Despite offering no real security, the Dancing Men cipher is popular for:

  • Escape rooms and puzzle hunts — it is visually distinctive and immediately recognisable to Sherlock Holmes fans.
  • Educational cryptography — it is an ideal introduction to substitution ciphers and frequency analysis before moving to stronger schemes.
  • Themed invitations and events — a birthday message encoded in stick figures makes for a memorable card.
  • Children’s activities — encoding and decoding short phrases is a fun introduction to the idea that symbols can carry hidden meaning.