Cipher Utility

Cipher Decoder

C

Paste a coded message to try the common decodings at once, or pick one of the 7 classical cipher tools below.

Examples

2. Possible readings

    Classical cipher tools

    CodeToolTypeKey
    C-01 Caesar CipherShift letters by a fixed amount, or try all 25 shifts at once. Substitution, one alphabet A shift from 1 to 25
    C-02 Vigenère CipherEncode and decode with a keyword. Substitution, many alphabets A keyword
    C-03 Vigenère DecoderBreak a Vigenère cipher without knowing the key. Solver for Vigenère Not needed
    C-04 Autokey CipherA Vigenère variant where the message extends the key. Substitution, many alphabets A keyword, then the message itself
    C-05 ROT13Rotate every letter by 13. The same step encodes and decodes. Substitution, one alphabet None (always 13)
    C-06 Atbash CipherSwap A with Z, B with Y, and so on. Substitution, one alphabet None
    C-07 Rail Fence CipherWrite the message in a zigzag and read it off row by row. Transposition The number of rails

    Other tools

    Cipher Utility reference card Series C, classical ciphers

    Types of ciphers

    Classical ciphers work on letters, and nearly all of them belong to one of two families.

    A substitution cipher replaces each letter with a different one. If the replacement never changes, so that every E becomes the same letter all through the message, the cipher uses one alphabet. Caesar, ROT13 and Atbash work this way. If the replacement changes from letter to letter, usually following a keyword, the cipher uses many alphabets. Vigenère and autokey are the common examples.

    A transposition cipher keeps the original letters and only changes their order. The rail fence cipher writes the message in a zigzag across a few rows and then reads the rows one after another.

    FamilyWhat changesTools here
    Substitution, one alphabetEach letter always becomes the same other letterCaesar, ROT13, Atbash
    Substitution, many alphabetsThe replacement shifts with each letter of a keywordVigenère, Autokey
    TranspositionThe letters stay the same and move to new positionsRail fence

    How to tell which cipher you have

    A few quick checks narrow it down before you try any tool.

    • If the text has only 0 and 1, only the digits 0 to 9 and letters a to f, or ends in one or two = signs, it is probably binary, hex or Base64. Those are encodings, and the encoding tools convert them back.
    • If the words keep their lengths and one letter shows up far more often than the rest, it is likely a substitution with one alphabet. In English that common letter usually stands for E or T.
    • If the letter counts look like normal English (lots of E, T, A and O) but the words are jumbled, the letters have probably been moved around. Try the rail fence tool.
    • If no letter stands out and the counts look flat, a keyword cipher such as Vigenère is the likely choice.

    Decoding a cipher without the key

    A Caesar cipher has only 25 possible shifts, so trying them all is enough. The decoder at the top of this page does that and shows the shift that reads best.

    A substitution with a mixed-up alphabet has far too many keys to try one by one. Frequency analysis works instead: count the letters, match the most common ones to E, T, A and O, and fill in the rest from short words such as THE and AND.

    For Vigenère, the first step is the length of the keyword. Repeated groups of letters in the ciphertext (the Kasiski method) and a statistic called the index of coincidence both point to it. Once the length is known, every letter of the key is a separate Caesar shift. The Vigenère decoder runs these steps for you.

    A rail fence cipher usually uses only a handful of rails, so you can try two, three, four and so on until the text reads normally.

    Frequently asked questions

    What is the easiest cipher to decode?

    The Caesar cipher. It has only 25 possible shifts, so you can try every one and read off the one that makes sense. The decoder at the top of this page does that for you. ROT13 is a Caesar cipher with a shift of 13, and Atbash has no key at all.

    Can a Vigenère cipher be decoded without the key?

    Often, yes. With a few sentences of text it is usually possible to work out the length of the keyword and then each of its letters. The Vigenère decoder does this automatically. Very short messages give it too little to work with.

    What is the difference between ROT13 and a Caesar cipher?

    ROT13 is a Caesar cipher with the shift fixed at 13. Because the alphabet has 26 letters, applying ROT13 twice gives back the original text, so the same step encodes and decodes.

    Which ciphers does the decoder on this page recognize?

    It tries Caesar (all 25 shifts), ROT13 and Atbash, plus Base64, hex, binary, URL and HTML encoding. It also warns you when the text looks like an MD5 or SHA hash. Vigenère, autokey and rail fence need a key or a rail count, so use their own tools.