ForHosting KIT · Developer Utilities

Dancing Men cipher

Turn plain letters into the stick figures of Conan Doyle's Dancing Men and back again: HI becomes two figure descriptions, one per letter, and anything that is not a letter is reported instead of guessed. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
HI
Calculation mode
Encode
You get
Result
face-R:armL-H:armR-U:legs-A face-L:armL-B:armR-D:legs-T
Encoding
dancing_men
Input length
2
Output length
55

This Dancing Men cipher tool encodes plain Latin letters into stick-figure pose descriptions inspired by Arthur Conan Doyle’s Sherlock Holmes story The Adventure of the Dancing Men, or decodes a stream of those figure tokens back into uppercase text. Each letter from A through Z has one fixed, unique pose token built from facing direction, left and right arm positions, and leg stance, so the transform is a reversible teaching table rather than a secret key.

Where the Dancing Men fit in lessons and puzzles

Developers and educators meet the Dancing Men in literature modules that cross into cryptography, capture-the-flag warm-ups that use classical monoalphabetic codes, and lightweight demos that show how a fixed pose table can still carry full Latin text one figure at a time. Frontend teams can show encode and decode side by side so learners see that two documented pose tokens are exactly HI without inventing a private alphabet. Backend services precompute challenge strings for puzzle APIs or teaching sandboxes where students must reassemble recognized figures to unlock the next step.

Quality engineers generate deterministic encode and decode pairs for contract tests so a middleware that claims Dancing Men support cannot silently switch to Atbash or drop unmapped reporting. Contest organizers precompute answer keys for modest English phrases without trusting opaque web toys that invent letters for unknown stick men. Pair it with other classical encoding helpers when you are building a small lab of free, deterministic text tools, and never treat the Dancing Men cipher as a substitute for modern authenticated encryption when real secrets are at stake.

Literary cipher and Holmes lessons

Encode and decode stick-figure pose tokens for classroom worksheets on Conan Doyle’s Dancing Men and monoalphabetic substitution.

Puzzle and CTF warm-ups

Build reversible figure streams for scavenger hunts and capture-the-flag challenges that teach classical ciphers without image assets.

What does the Dancing Men cipher tool cost?

It is free in your browser on this page.

How do I decode Dancing Men figures?

Send the space-separated pose tokens as text and set mode to decode (or dec, decrypt, d). Encoding is the default when mode is omitted.

Which characters are encoded?

Only alphabetic letters A–Z in either case. Decode accepts the documented pose tokens (case-insensitive) plus common separators between figures.

Is the Dancing Men cipher secure for real secrets?

No. It is a classical literary teaching cipher with a public fixed table. Use modern authenticated encryption such as AES-GCM for real confidentiality.

What do the parts of each Dancing Men figure mean?

Each figure describes one stick man: which way he faces, where his left and right arms are (up, horizontal, down or bent) and how his legs stand, together, apart or striding. Every letter from A to Z has its own fixed pose.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/dancing-men

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/dancing-men \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"HI"}'
{
  "text": "HI"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.dancing_men",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Encode mode walks the input, keeps alphabetic characters, skips whitespace, emits space-separated figure tokens, and lists any non-letter symbols in unmapped_letters so you can see what did not enter the cipher. Decode mode splits tokens on whitespace and common separators, rebuilds the message from known poses, and reports unknown tokens in unmapped_figures instead of inventing letters. Empty input, a string with no A–Z letters on encode, or a decode stream with no recognized figures fails with invalid_input. Use it free in the browser for literary-cipher lessons, Holmes puzzle worksheets, and reversible figure demos, or call the API at $0.002 per successful request when pipelines need reproducible Dancing Men transforms.

What the Dancing Men cipher is and what this tool returns

The Dancing Men cipher is the stick-figure monoalphabetic code that appears in Conan Doyle’s Holmes adventure of the same name: each letter of a secret message is drawn as a tiny man in a distinct pose, and Holmes reconstructs the alphabet from frequency and cribs just as he would for any simple substitution. Each token follows a compact grammar: face left or right, left arm up horizontal down or bent, right arm with the same four options, and legs together, apart, stride-left, or stride-right. That grammar yields far more than twenty-six combinations; the endpoint uses one stable assignment for A through Z so H always becomes the same figure string and that string always returns H. Historically the men were ink drawings on paper; this endpoint only exposes the letter-to-description map so teachers, puzzle authors, and test authors can work with the codes without shipping image assets. The JSON response always includes result for the transformed string, encoding fixed to dancing_men, mode set to encode or decode, input_length and output_length for the raw strings you sent and received, letter_count and figure_count for how many A–Z letters or pose tokens were produced or consumed, unmapped_letters and unmapped_figures arrays for symbols or tokens the table could not map, and a formula string that restates the pose grammar for documentation and automated checks. There is no streaming path and no silent fallback to Baconian, Morse, or a Vigenère keyword: either the payload is valid for the chosen mode, or the request fails with invalid_input. If you need polyalphabetic ciphers, ROT variants, or modern authenticated encryption, use those dedicated endpoints; this landing answers only the Dancing Men stick-figure contract that literary-cipher chapters already describe.

How text and mode are read and how unmapped items are reported

still yields figures for H and I while reporting the exclamation mark. In decode mode the stream is split on spaces, tabs, newlines, commas, semicolons, and pipes; each non-empty token is looked up in the inverse table. The preferred payload fields are text for the message or figure stream and optional mode for encode or decode. Text accepts aliases such as input, value, s, message, plaintext, and ciphertext so forms and SDK clients can reuse existing column names. Mode defaults to encode when omitted and also accepts short aliases such as enc, encrypt, e for encode and dec, decrypt, d for decode; any other string fails validation. In encode mode only alphabetic letters are kept and mapped, case is ignored on the way in, whitespace is skipped without being treated as an error, and the result is space-separated pose tokens; characters that are neither letters nor whitespace are collected in order into unmapped_letters so a string like HI! If no letter remains after filtering, the engine rejects the request with invalid_input so a digit-only string does not look like a successful empty cipher. Known tokens append an uppercase letter; unknown tokens append nothing to result and are listed in unmapped_figures so you can see which figures failed recognition. If every token is unknown, the request fails with invalid_input rather than returning an empty success. Missing text, empty text, non-string types, and unknown modes likewise raise invalid_input. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline. Invalid inputs return invalid_input and are not charged, which keeps validation cheap while successful transforms remain a fixed item price.

Where Dancing Men fits in lessons, puzzles, and test fixtures

Product and education tools use the transform when a learner pastes a figure stream and the UI must show both the recovered letters and any unmapped_figures under the documented table. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the transformed result.

Deterministic CI fixtures

Generate reproducible Dancing Men ciphertext and plaintext pairs for unit tests, golden files, and contract checks.

What happens to punctuation and digits on encode?

They are not mapped to figures. Whitespace is skipped; other non-letters appear in unmapped_letters while A–Z letters still encode. If no letters remain, the request fails with invalid_input.

Read the full KIT documentation →