Unscramble Words 4U

Home › Guides › Types of ciphers, and how to decode them

Types of ciphers, and how to decode them

Last updated: 19 October 2026 · About 5 minutes to read

The main types of ciphers are substitution ciphers, which swap each letter for another (Caesar, ROT13, Atbash, pigpen and cryptograms); polyalphabetic ciphers, which change the swap as they go (Vigenère); and transposition ciphers, which keep the letters but change their order (rail fence). Encodings such as binary and Base64 look secret but are not ciphers.

Codes, ciphers and encodings

People often use these words loosely, but they mean different things:

  • A cipher changes letters by following a rule, often with a secret key. HELLO with a Caesar shift of 3 becomes KHOOR.
  • A code replaces whole words or ideas with other words, numbers or symbols, usually from a codebook.
  • An encoding, such as binary, hexadecimal or Base64, turns text into another format so computers can store or send it. Anyone can reverse it; it is not meant to be secret. Morse code is also an encoding, despite its name.

Substitution ciphers

In a substitution cipher, each letter is replaced by another letter or symbol, and the same replacement is used every time.

Caesar cipher

Every letter moves the same number of places along the alphabet, wrapping round from Z to A. The Roman historian Suetonius wrote that Julius Caesar used a shift of three.

Shift 3: HELLO WORLD → KHOOR ZRUOG

With only 25 possible shifts, it is easy to crack by trying them all. The Caesar cipher tool does exactly that.

ROT13

A Caesar cipher with a shift of 13. Because the alphabet has 26 letters, applying ROT13 twice gets you back where you started, so the same step encodes and decodes. It was widely used online to hide spoilers and puzzle answers. HELLO → URYYB. Try the ROT13 tool.

Atbash

The alphabet is reversed: A becomes Z, B becomes Y, and so on. It began as a cipher for the Hebrew alphabet. HELLO → SVOOL. See the Atbash cipher tool.

Simple substitution (cryptograms)

Each letter is swapped for a different letter chosen at random, so there are far too many keys to try one by one. These are cracked using letter frequencies and word shapes, which is how newspaper cryptograms are solved. See our guide on how to solve cryptograms.

Pigpen cipher

Letters are replaced by symbols taken from a pair of grids and a pair of crosses, some with dots. It is still a simple substitution, just with shapes instead of letters. It is associated with the Freemasons in the 18th century and is a favourite in escape rooms. Use the pigpen cipher key and translator.

Polyalphabetic ciphers

Vigenère cipher

A keyword decides a different Caesar shift for each letter. With the key KEY, the first letter is shifted by K (10 places), the second by E (4), the third by Y (24), then the key repeats.

Key KEY: HELLO → RIJVS

Notice that the two Ls become different letters, J and V, which hides the letter frequencies that break simple substitution.

It was described by Giovan Battista Bellaso in 1553 and later credited to Blaise de Vigenère. It resisted attack for about 300 years until general methods for breaking it were published in the 19th century. The Vigenère tool can encode, decode and try to crack it without the key.

Transposition ciphers

Instead of changing letters, a transposition cipher rearranges them. The letters in the message are all still there, just in a different order.

Rail fence with two rails: write MEET AT NOON in a zigzag over two rows, then read each row in turn.

M . E . A . N . O .
. E . T . T . O . N

Reading the top row then the bottom row gives MEANO ETTON.

A clue that you have a transposition cipher: the letter frequencies look like normal English (lots of E, T and A), but the words are nonsense.

Machine ciphers

In the 20th century, machines such as the German Enigma combined many substitutions that changed with every key press. Breaking Enigma at Bletchley Park during the Second World War is one of the most famous stories in codebreaking. Modern encryption, used for online banking and messaging, is done by computers using mathematics far beyond these hand ciphers.

How to decode a cipher you do not recognise

  1. Look at the symbols. Dots and dashes are Morse code. Only 0s and 1s in groups of eight is probably binary. Digits and the letters A to F suggest hexadecimal. A long mix of letters, digits and perhaps + and /, sometimes ending in =, is often Base64. Grid-shaped symbols are probably pigpen.
  2. Look at the letters. If it is ordinary letters with the word spaces kept, it is probably a substitution cipher. Try all Caesar shifts first, then treat it as a cryptogram.
  3. Count the letters. If common letters like E, T and A are common in the message too, the letters may only have been rearranged (transposition). If the counts are very even, suspect Vigenère.
  4. Look for numbers. Numbers from 1 to 26, such as 8-5-12-12-15, are usually letters to numbers (A = 1).

The cipher decoder does the first round for you: paste a message and it tries Caesar shifts, ROT13, Atbash, Vigenère, binary, hexadecimal, Base64, letter numbers, Morse code and reversed text, and ranks the results by how much they look like English. All our codes and ciphers tools run in your browser, so your messages are not sent anywhere.

Questions and answers

What are the main types of ciphers?

The main types are substitution ciphers (such as Caesar, Atbash and pigpen), polyalphabetic ciphers (such as Vigenère) and transposition ciphers (such as the rail fence).

What is the difference between a code and a cipher?

A cipher changes individual letters by a rule. A code replaces whole words or ideas with other words, numbers or symbols.

How do you decode a Caesar cipher without the key?

Try all 25 possible shifts and look for the one that makes readable English. A Caesar cipher tool can do this instantly.

Is Base64 a cipher?

No. Base64 is an encoding that turns data into letters and numbers. Anyone can decode it, so it does not keep a message secret.

What is the easiest cipher for children?

The Caesar cipher and pigpen are good first ciphers. They are simple to learn and fun to write by hand.

Tools for this guide

More guides