Skip to main content

The A1Z26 Cipher Explained: Turning Letters Into Their Alphabet Position

A1Z26 swaps each letter for its alphabet position — A is 1, Z is 26. A plain-language guide to the simplest substitution cipher, with a worked HELLO example.

Published By Li Lei
#ciphers #puzzles #ctf #a1z26 #text

The A1Z26 Cipher Explained: Turning Letters Into Their Alphabet Position

The A1Z26 cipher might be the first code a lot of people ever learn, even if they never hear its odd little name. The rule is the whole thing: replace every letter with the number it occupies in the alphabet. A is 1, B is 2, C is 3, and you keep counting until Z lands on 26. That is it. No key, no table to memorize beyond the alphabet you already know, no math past counting to twenty-six.

What makes it worth a closer look is precisely how plain it is. Most ciphers hide a method behind a key. A1Z26 hides nothing — the name is the instruction set, from A1 to Z26 — and that openness is the point. It exists to be solved, not to keep a secret. That is why it turns up in cartoon credits, escape rooms, and beginner capture-the-flag puzzles, and almost never anywhere that real privacy is on the line.

How A1Z26 actually works

Picture the alphabet laid out with a number under each letter. A sits over 1, B over 2, and the count runs straight through to Z over 26. To encode a word, you walk through it letter by letter and write down each number. To decode, you do the reverse: take each number and find the letter sitting above it.

The one concrete rule worth fixing in your head is that the number comes from the letter's position in the alphabet, not from any character code your computer uses internally. So A is 1 because it is the first letter, full stop. Case does not matter — a lowercase a and an uppercase A both map to 1 — and anything that is not a letter, like a digit or a punctuation mark, just passes through untouched.

Because each letter maps to exactly one number and back again, the cipher is fully reversible. Encode a message, hand someone the numbers, and they can rebuild your text with no information lost. That clean round trip is what makes it a good teaching tool: you can check your own work by running it backward.

A worked example: encoding HELLO

Let me run the classic example all the way through, because seeing it land is faster than any explanation.

Take the word HELLO. Walk through it one letter at a time:

  • H is the 8th letter, so H is 8
  • E is the 5th letter, so E is 5
  • L is the 12th letter, so L is 12
  • L again is 12
  • O is the 15th letter, so O is 15

String those together and HELLO becomes 8-5-12-12-15. Paste 8-5-12-12-15 back through the decoder and you get HELLO again — the trip works in both directions, which is the whole appeal.

Two things in that example trip people up. First, the double L shows the cipher does not collapse repeats: each L is its own 12, so you see 12-12, not a single one. Second, notice L is 12, a two-digit number — not a 1 followed by a 2. Read it as 1 and 2 and you would get AB instead of L. That ambiguity is exactly why separators matter, which brings us to the next part.

You can try this yourself in the A1Z26 cipher tool: type HELLO, watch 8-5-12-12-15 appear, then flip the toggle and decode it straight back.

Separators: hyphen, space, or comma

A run of numbers like 8512121 5 is unreadable, so A1Z26 puts separators between the numbers. Convention uses two levels. Inside a single word the numbers are joined by a small separator — most often a hyphen, sometimes a plain space or a comma — and a wider space marks the boundary between words.

So HELLO WORLD comes out as 8-5-12-12-15 23-15-18-12-4. The hyphens hold each word together, and the gap in the middle tells the decoder where one word stops and the next begins. Decode that and the word break comes back as a space, rebuilding the original two-word phrase cleanly.

Which small separator you pick is purely cosmetic — hyphen gives 8-5-12-12-15, space gives 8 5 12 12 15, comma gives 8,5,12,12,15 — so the right choice is whatever style the puzzle you are solving already uses. The only thing to avoid is collapsing both levels into one space, which makes 8 5 ambiguous against a word break. Keep the word gap visibly wider and the message stays unambiguous.

Why it lives in puzzles, not security

A1Z26 shows up wherever a puzzle wants to reward a flash of recognition rather than raw computing power. Gravity Falls famously buried A1Z26 messages in its end credits, sharing the slot with Caesar and Atbash ciphers across the run, and sent a wave of fans counting letters on scrap paper. Escape rooms love it because a clue encoded as numbers can be cracked with nothing but a pen and the alphabet. Beginner CTF challenges drop a string of numbers in the 1-to-26 range as a tell: that narrow range almost always means A1Z26, not ASCII or hex.

The flip side is that it offers zero secrecy. There is no key to guess, so anyone who recognizes the pattern reads the message instantly. Treat it as a game, never as protection for a password or anything that genuinely needs to stay private. If you want something with an actual key that resists casual reading, a shift cipher like the Caesar cipher tool is the natural next step up, and it pairs well with A1Z26 in layered puzzles.

Where I keep reaching for it

I built a tiny treasure hunt for a friend's kid last winter, and A1Z26 was the obvious first clue — simple enough that a seven-year-old could crack it with a printed alphabet taped to the fridge, satisfying enough that she ran around the house for the next one. The phrase was short, the numbers fit on an index card, and the only "tool" she needed was counting. Later I used it again to author a warm-up round for a small CTF workshop, encoding a flag fragment by hand in about a minute. Both times the appeal was the same: it teaches what a substitution cipher is without any of the machinery, and it never once pretended to be more than a game. That honesty is rarer than it sounds, and it is why A1Z26 stays in my back pocket.

If you want to skip the by-hand counting for anything longer than a word or two, paste your text or numbers into the A1Z26 cipher tool — it encodes and decodes both directions, tolerates messy separators copied out of a chat thread, and runs entirely in your browser.


Made by Toolora · Updated 2026-06-13