ENCODE
ANYTHING.
One console, 10 classic ciphers and encodings. Turn a message into Morse, binary, NATO, braille, Roman numerals, Caesar or Atbash - or paste one back to read it.
THE CIPHERS & ENCODINGSÂ â—¢
10 public-domain classics · more on the way
Not sure which cipher you’re looking at? Paste it into the Cipher Identifier → Got a substitution cipher with no key? The Cryptogram Solver cracks it →
Dots and dashes. Letters split by spaces, words by /.
Developed in the 1830s and 40s by Samuel Morse and Alfred Vail for the electric telegraph, Morse code turns language into timed on/off pulses a single wire can carry. It was the backbone of long-distance and maritime signalling for over a century, and its distress call - SOS, ...---... - is still recognised the world over.
8-bit ASCII. Each character becomes eight ones and zeros.
Binary writes every character as a run of 0s and 1s, the only two states a digital circuit needs. The scheme used here is ASCII, standardised in 1963, which gives each letter, digit and symbol its own 7-bit code, written here padded to eight bits a character - the layer sitting underneath essentially all the text a computer stores.
Alfa Bravo Charlie - the radio spelling alphabet.
The NATO phonetic alphabet - Alfa, Bravo, Charlie - was finalised in 1956 to spell letters out unambiguously over noisy radio. Each code word was picked to stay intelligible across many languages, which is why aviation, the military and emergency services still use it today.
Grade-1 braille. Each letter becomes a raised-dot cell.
Louis Braille, blind since childhood, devised his raised-dot system in 1824 at the age of 15, adapting a military "night writing" code. Each character is a cell of up to six dots read by touch, and it remains the primary tactile writing system for blind readers worldwide.
Numbers the Roman way. 2024 becomes MMXXIV.
Roman numerals build numbers from letters - I, V, X, L, C, D, M - by adding and subtracting, a system Rome inherited from the Etruscans and used across its empire. Clumsy for arithmetic, they survive on clock faces, book chapters, monuments and film copyright dates.
Rome’s cipher. Every letter slides three along the alphabet.
Named for Julius Caesar, who used it around the 1st century BC to protect military messages, the Caesar cipher shifts every letter a fixed number of places along the alphabet. It is one of the oldest and simplest substitution ciphers - and, with only 25 possible shifts, one of the easiest to break.
Read the story: Decoder Ring History →Mirror the alphabet - A becomes Z, B becomes Y.
Atbash is an ancient Hebrew cipher that mirrors the alphabet, swapping the first letter for the last, the second for the second-last, and so on. It appears in the Hebrew Bible, in the Book of Jeremiah, and is self-reversing: encoding and decoding are the exact same operation.
Read the story: The Zodiac Ciphers →Move the leading sound to the end and add a knock-off Latin ending.
Pig Latin is a playful English word game rather than a real language, recorded since at least the 19th century. The rule is simple - move the opening consonant sound to the end and add "-ay" - turning "hello" into "ellohay" and letting children (and the odd trainee spy) talk in near-code.
Letters as numbers - A is 1, Z is 26.
The A1Z26 cipher swaps each letter for its position in the alphabet: A is 1, B is 2, on up to Z at 26. It needs no key and hides plain words inside strings of numbers, which makes it a staple of puzzle hunts and escape rooms.
Read the story: The Beale Ciphers →RFC 4648 text-safe binary encoding - the format behind data URIs and email attachments.
Base64, standardised as RFC 4648, encodes binary data using 64 printable characters so it can travel safely through text-only channels. It keeps nothing secret - anyone can decode it - but it is everywhere, quietly carrying email attachments, data URIs and web tokens.
PLAY ANOTHER →
Crack a substitution cipher with no key - from the shape of its words.
AUTO-SOLVE · NO KEY NEEDEDCODESCaesar Cipher DecoderShift the alphabet to encode - or brute-force all 25 to crack it.
SHIFT 1-25 · ROT13CODESBinary TranslatorText to 8-bit binary and back. 01100011 01101100.
ASCII 1963CODESBraille TranslatorTurn text into Grade-1 braille cells and back.
â ‹â ‘â ‘â ‡ â Šâ žSignalling rather than writing? The full A-Z charts for flag semaphore and the nautical signal flags are here too.
Curious where these ciphers come from? Read the codebreaking & spycraft history → Or write your name in Runes, Ogham, Phoenician & more ancient scripts →
THE SHORT ANSWERÂ â—¢
A cipher works on letters. A code works on meanings. Almost everything else about the two words follows from that one difference, and it is a technical distinction rather than a loose one.
To encipher ADVANCE AT DAWN you do something to the A, then to the D, then to the V, one small unit at a time, and every unit is the same size. To encode it you look the phrase up in a book that prints an arbitrary group beside it, say XYVAK. The cipher never learns what the message says. The code never learns anything else.
A third thing sits in the same drawer and is not secret writing at all. Base64, binary, Morse and the NATO phonetic alphabet are encodings: fixed, published ways of respelling a message so it survives a channel. Nothing is withheld, so there is nothing to break.
Key Takeaways
- A cipher works on units of fixed size, usually single letters. A code substitutes for whole words, phrases and sentences, and needs a code book.
- Every cipher does one of two things, or both. Substitution swaps the symbols; transposition keeps the symbols and moves them.
- A monoalphabetic cipher uses one alphabet throughout, which leaves letter frequencies showing. A polyalphabetic cipher rotates several to flatten them.
- Encoding is not encryption. RFC 4648 says base encoding "does not provide any computational confidentiality". Morse is published by the ITU. Neither has a key.
- Kerckhoffs set the governing rule in 1883, and it still holds: the method may be public, the key may not.
What actually separates a code from a cipher
William Friedman drew the line in one sentence in 1928, in Training Pamphlet No. 3 of the War Department's Office of the Chief Signal Officer. In cipher systems, he wrote at paragraph 84, "we deal with units of equal length (single letters, pairs, or groups of definite length), applying some form of transposition, or substitution, or a combination of the two principles to these units". In code systems "we deal with units of unequal length", running from single letters up to entire sentences, with an arbitrary group from a code book standing in for each one.
The practical consequences are large. A cipher, Friedman noted on the same page, "may necessitate the use of no apparatus whatsoever, other than pencil and paper". A code requires "the possession of identical copies of a code book by all the correspondents". He then added the detail behind most of the confusion in ordinary speech: "Code books are often simply termed codes."
That book is also a hard ceiling on what a code can say. Parker Hitt, writing for the US Army in 1916, ruled codes out of general field use for exactly that reason: "The necessity for exact expression of ideas practically excludes the use of codes for military work although it is possible that a special tactical code might be useful for preparation of tactical orders." If the sentence you need is not in the book, you cannot send it.
| Property | Cipher | Code | Encoding |
|---|---|---|---|
| Unit it operates on | Single letters, or groups of a fixed length | Words, phrases and sentences, sometimes single letters | Characters or bytes |
| What the recipient needs | Knowledge of the system and the key | A matching copy of the code book | The published specification |
| Where the secret sits | In the key | In the book | Nowhere |
| Familiar examples | Caesar, Atbash, Vigenere | The War Department Code, the Western Union Code | Base64, Morse, the NATO phonetic alphabet |
Why the line between code and cipher blurs
Both manuals warn that the boundary is a gradient rather than a wall, and both put a code inside the cipher family rather than beside it.
Hitt, on page 24 of his manual: "cipher methods blend into code work, for a code is, after all, only a specialized substitution cipher." Friedman, twelve years later, reached the same verdict from the other side, writing that some code systems "so closely approach cipher systems that no sharp line of demarcation can be established to separate code from cipher systems".
Hitt's own worked example is Napoleon. On page 92 he writes: "The ciphers of Napoleon were long series of numbers representing letters, syllables and words. They were really codes". By his own definition the familiar label is wrong, because the units being replaced were not all the same size. He generalises in the same paragraph: "The War Department Code, the Western Union Code, and, in fact, all codes are nothing but specialized substitution ciphers in which each code word represents a letter, word or phrase of the plain text."
The two also get stacked deliberately. Friedman's fourth paragraph defines enciphered code, where the groups produced from a code book are put through a cipher afterwards. He records exactly when that is worth the trouble: where a high degree of secrecy must be maintained, or where the code book employed is not itself kept secret. A code book is a physical object that many people must hold, and physical objects get captured.
Substitution and transposition: the two things a cipher can do
Hitt opens his chapter on classes of ciphers with a claim that has survived a century of cryptography: "There are, in general, two classes of ciphers. These are the transposition cipher and the substitution cipher."
Substitution replaces the symbols and leaves the positions alone. Transposition leaves every symbol exactly as it is and changes the order. At the head of his fifth chapter Hitt puts it as a figure: "A transposition cipher is like a picture puzzle; the parts are all there and the solution merely involves their correct arrangement."
Telling them apart is the first move in classical cryptanalysis, and it is a counting exercise rather than a guess. Hitt gives the test on page 24. Count the letters in the message, then the vowels AEIOU, then the common consonants LNRST, then the rare consonants JKQXZ. In English those groups run at about 40 percent, 30 percent and 3 percent of the whole. A transposition cipher does not touch the letters, so those proportions come through intact. If the counts miss by more than 5 percent either way, Hitt concludes, "the cipher is certainly a substitution cipher".
He gives the Spanish figures too, at 45 percent, 30 percent and 2 percent, which is a reminder that the test is a property of the language and not of the cipher. A cipher identifier applies tests of this family to an unknown message, and what it returns is the class the message belongs to rather than the plaintext.
The two methods can be combined, and the combination announces itself once the substitution layer has been stripped away. Hitt sets out the tell on page 92: "The frequency table of the result will resemble the normal frequency table, although the message will still be unintelligible and we will know at once that it is a transposition cipher for further solution."
One alphabet or many, and why a Caesar falls in seconds
A monoalphabetic cipher uses a single cipher alphabet for the whole message. The Caesar shift is the simplest case, moving every letter the same number of places, which leaves only twenty-five keys to try. Atbash is simpler still and has no key at all: it maps the first letter of the alphabet to the last, the second to the second last, and is therefore its own inverse.
Friedman's paragraph 30 explains why the whole class collapses. Ciphers of that kind "are very easily solved because the frequencies of the cipher characters correspond to a greater or lesser degree with the frequencies of the letters of normal plain text". The disguise is only a rename. Whichever letter now stands for E turns up about as often as E did, and the shape of the language comes through the mask.
Polyalphabetic ciphers exist to break that link. Several cipher alphabets are used within one message, Friedman writes, "for the purpose of eliminating the frequency characteristics of the symbols employed in the cryptogram". Vigenere is the schoolbook case, tabulated at his paragraph 33: a key word selects a different alphabet for each successive letter, so one plaintext E becomes several different ciphertext letters and one ciphertext letter stands for several different plaintext letters. The single frequency count that solves a Caesar shift now has several overlapping distributions smeared together, and the analyst has to find the length of the repeating cycle before the counting can start again. Friedman's paragraph 34 divides the whole class on that point, into periodic systems whose text breaks into regular blocks enciphered by identical parts of the key, and nonperiodic ones that do not.
Encodings keep no secret at all
The United States government's own security glossary makes the split explicit, and it does so with an example from this very family. To encode is to "Use a system of symbols to represent information, which might originally have some other representation", and the illustration the definition offers is Morse code. Encryption is a separate entry with a separate job: "The cryptographic transformation of data to produce ciphertext."
Representation on one side, concealment on the other. Morse is published as Recommendation ITU-R M.1677-1 by the International Telecommunication Union, which fixes both the characters and the timing, down to the length of the gaps: a dash equals three dots, and the space between two words equals seven. Anyone may read the recommendation. That is what it is for.
Base64 says the same thing about itself. RFC 4648 exists so that data can move through environments "restricted to US-ASCII" text, and its security section is blunt about the limits. Base encoding "visually hides otherwise easily recognized information, such as passwords, but does not provide any computational confidentiality". The RFC even describes the incident it keeps causing: someone pastes a protocol exchange to illustrate an unrelated problem and reveals a password, "because she is unaware that the base encoding does not protect the password".
The rest of the family behaves the same way. Binary and hexadecimal are the same bytes written in another radix. Roman numerals are a numeral system. The NATO phonetic alphabet is a set of spoken words chosen so that letters survive a noisy radio channel. None of them has a key, so none of them can be attacked. You either know the table or you look it up, which is why a Base64 encoder and decoder runs in both directions with no more ceremony than a dictionary.
Where the secret has to live
Auguste Kerckhoffs settled the underlying principle in his 1883 Paris monograph La cryptographie militaire. He listed six requirements for a cipher fit for military use. The second is the one still quoted: "Il faut qu'il n'exige pas le secret, et qu'il puisse sans inconvénient tomber entre les mains de l'ennemi". Rendered in English, that is a demand that the system must not require secrecy and must be able to fall into enemy hands without doing harm.
His third requirement points the same way. The key must be communicable and memorable without written notes. The system is public and durable; the key is private and disposable.
Friedman formalised the same split forty-five years later. Practically every cipher message, he wrote on his first page, is the joint application of two elements: a general system "which, once agreed upon, is invariable or unchanging in nature", and a specific key "which is variable or changeable at the will of the correspondents".
A cipher has a key you can change tonight. A code has a book you would have to reprint and redistribute, which is why a captured code book is a disaster and a captured cipher device, by Kerckhoffs's second requirement, should not be.
Hitt drew the honest conclusion for the ciphers of his own day in the first paragraphs of his manual: "no practicable military cipher is mathematically indecipherable if intercepted; the most that can be expected is to delay for a longer or shorter time the deciphering of the message by the interceptor."
Frequently asked questions
Is Morse code a code or a cipher?
Neither, in the technical sense. Morse is an encoding, a published mapping from written characters to timed pulses, standardised by the International Telecommunication Union as Recommendation ITU-R M.1677-1. There is no key and nothing withheld, so it cannot be broken, only read.
Why is Base64 not encryption?
Because it conceals nothing from anyone who recognises it. RFC 4648, the standard that defines Base64, states that base encoding "does not provide any computational confidentiality". Its purpose is to move arbitrary data intact through channels that only accept plain ASCII text. Anyone who spots the alphabet can reverse it in seconds without knowing anything at all about the sender.
What is the difference between substitution and transposition?
Substitution replaces each symbol with a different one and leaves the positions alone. Transposition leaves every symbol exactly as it is and changes their order. Parker Hitt's 1916 manual likens the second kind to a picture puzzle, where every part is already present and the work is putting them back in the right places.
What makes a polyalphabetic cipher harder than a monoalphabetic one?
A monoalphabetic cipher uses one cipher alphabet from start to finish, so the letter frequencies of the plaintext pass through unchanged and give the message away to a simple count. A polyalphabetic cipher rotates several alphabets through the same message, which William Friedman's 1928 training pamphlet describes as being done precisely to eliminate those frequency characteristics.
Can something be both a code and a cipher?
Yes, and the practice had a name. Friedman's pamphlet defines enciphered code, in which the groups produced from a code book are then put through a cipher, reserved for cases where a high degree of secrecy must be maintained, or where the code book is not itself kept secret. Hitt had made the wider point twelve years earlier, treating a code as a specialised kind of substitution cipher rather than a separate species.
Sources
- Parker Hitt, Manual for the Solution of Military Ciphers, Press of the Army Service Schools, Fort Leavenworth, 1916. Introduction (p. v), Chapter IV (pp. 23 to 24), Chapter V (p. 26) and p. 92. Retrieved 13 August 2026, https://archive.org/details/manualforsolutio00hittrich
- William F. Friedman, Elements of Cryptanalysis, War Department Training Pamphlet No. 3, Office of the Chief Signal Officer, Washington, 1928. Section I paragraphs 2, 4 and 5 (pp. 1 to 2), paragraphs 30, 33 and 34 (pp. 34 to 37) and paragraph 84 (p. 119). Retrieved 13 August 2026, https://archive.org/details/41760269079943
- Auguste Kerckhoffs, La cryptographie militaire ou Des chiffres usités en temps de guerre, Paris, Librairie militaire de L. Baudoin et Cie, 1883. Section II, the six desiderata (pp. 8 to 9). The work is generally recorded as first appearing that year in the Journal des sciences militaires, whose pagination differs; the edition read here, and the one these page numbers belong to, is the Paris book. Retrieved 13 August 2026, https://archive.org/details/lacryptographie00kercgoog
- Internet Engineering Task Force, RFC 4648, The Base16, Base32, and Base64 Data Encodings, S. Josefsson, October 2006. Sections 1 and 12. Retrieved 13 August 2026, https://www.rfc-editor.org/rfc/rfc4648.txt
- International Telecommunication Union, Recommendation ITU-R M.1677-1, International Morse code, October 2009. Annex 1, Part I, sections 1 and 2. Retrieved 13 August 2026, https://www.itu.int/rec/R-REC-M.1677/en
- National Institute of Standards and Technology, Computer Security Resource Center Glossary, terms encode (from CNSSI 4009-2015, itself from IETF RFC 4949) and encryption. Retrieved 13 August 2026, https://csrc.nist.gov/glossary/term/encode