monoalphabetic · frequency analysis · local

Crack a substitution cipher

Frequency-analysis aid for monoalphabetic substitution ciphers. Auto-guess from letter frequency, then refine mappings manually until plaintext emerges.

Substitution Cipher Solver
Letters
0
0 unique
Mapped
0
/ 26
Bigrams
0
—
Trigrams
0
—
Common EN: TH HE IN ER AN · THE AND ING HER HAT
input · ciphertext
output · decoded + mapping
—
A0
B0
C0
D0
E0
F0
G0
H0
I0
J0
K0
L0
M0
N0
O0
P0
Q0
R0
S0
T0
U0
V0
W0
X0
Y0
Z0
Quick Start

How frequency analysis works

In English, E is the most common letter, then T, A, O, I, N. Auto-guess maps cipher letters to English letters by frequency rank — often gets you 50-70% right; refine manually.

  1. 01

    Paste cipher

    Any monoalphabetic substitution.

    Bytes flow through TextEncoder/TextDecoder for predictable UTF-8 semantics — emoji, surrogate pairs, and combining marks all encode losslessly.

    inputUTF-8TextEncoderlosslesslive
    input · raw bytescipher · UTF-8
    QEBOB FP …
    loaded · UTF-8MIME · ready
  2. 02

    Auto-guess

    Map cipher letters by frequency rank to English.

    Hash and signature operations call crypto.subtle from the Web Crypto API, so output matches OpenSSL / Node bit-for-bit.

    guessWeb Cryptosubtledeterministiclive
    guess · optionsfreq · live
    Q → E
    options applied · livelive
  3. 03

    Refine

    Use bigrams (TH, HE) and trigrams (THE) to confirm.

    Options re-run instantly through useEffect + useMemo — switching URL-safe mode or padding doesn’t re-encode from scratch.

    refinememoisedoptionsinstantreactive
    refine · encodedngram · ready
    THE = 12
    encoded · livelossless
  4. 04

    Read plaintext

    Final plaintext shown above the mapping grid.

    Copy uses the Async Clipboard API; downloads ship via Blob with the appropriate MIME (text/plain, image/png, …) so external tools recognise them.

    readclipboardblobMIME-correctclient-side
    ok · copiedready · done
    There is …
    shipped · ready to shipsuccess
Pro tips

Encoding without surprises

Always UTF-8 first

Use TextEncoder / TextDecoder for bytes ↔ string conversion. btoa alone breaks on non-ASCII.

URL-safe vs standard Base64

Standard uses +, /, =; URL-safe swaps to -, _, no padding. Don’t mix them.

Hashes aren’t passwords

SHA-256 is fast; that’s good for fingerprints, bad for passwords. Use bcrypt / argon2 for credentials.

Watch padding rules

Some decoders are strict about = padding, others auto-pad. If round-trips fail at exactly 1 or 2 bytes, check padding.

Use Web Crypto for keys

Generate cryptographic keys via crypto.subtle, never Math.random. The latter is predictable.

JWT decode ≠ verify

Decoding a JWT just splits and base64-decodes. Verification needs the issuer’s public key / shared secret.

Use Cases

When to break a cipher

Puzzles, classroom, history.

Cryptograms

Newspaper-style word puzzles. Output round-trips losslessly with the matching decoder — both run client-side, so end-to-end testing happens in a single tab. Encoding flows through TextEncoder for predictable UTF-8 semantics.

RFC-compliant

Classroom

Teach frequency analysis hands-on. Web Crypto's subtle.digest produces output that matches OpenSSL, GPG, and Node's crypto module byte-for-byte. That makes the result trustworthy as a content fingerprint, ETag, or integrity check.

OpenSSL-matched

Historical ciphers

Crack 18th-century diplomatic codes. Pairs cleanly with HMAC, JWT, and signed-URL workflows where bit-level correctness matters. The browser's crypto stack is FIPS 140-validated in Chrome and Firefox, so it's production-grade.

lossless

CTF challenges

Quick win for beginner crypto puzzles. Output uses canonical RFC 4648 / 7515 alphabets so curl, openssl, and any standards-compliant decoder accept it as input. URL-safe variants drop padding for tokens that travel in query strings.

byte-identical

Demo

Show why substitution is weak. Heavy hashing runs through useMemo so large inputs don't block typing. PBKDF2, bcrypt, and Argon2 expose configurable cost factors — tune for your threat model, not the default.

spec-grade

Escape rooms

Online tool for cipher-based escape games. Same input plus same options always yields identical bytes. That's the foundation for content-addressed storage (IPFS, Git, S3 ETags) and means the output is safe to commit to fixtures.

production-ready
FAQ

Frequently asked questions

No — only monoalphabetic substitution. Modern ciphers (AES, RSA) are immune to frequency analysis.
Built for English (its frequency profile). Other languages need different frequencies.
This solver assumes a single substitution alphabet. Vigenère needs polyalphabetic methods (Kasiski exam, Friedman test).
200+ letters give reliable frequency. Short texts mislead.
Yes — all analysis runs in your browser. Nothing is sent to a server.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!