Skip to content

Atbash Cipher Decoder

Swap each letter with its opposite in the alphabet. A becomes Z, B becomes Y, and the same swap decodes the result.

Result

Enter text

How to Use

  1. 1 Paste the text.
  2. 2 Choose Decode.
  3. 3 Copy the swapped letters. Run the result through the page again to return to the original letters.

Example Output

  • Hello becomes Svool.
  • A number such as 2026 is unchanged.

About This Tool

Atbash is a reversible letter substitution. This page uses the English alphabet only. Digits, spaces, and punctuation stay where they are.

Using the Atbash Decoder

Atbash replaces each letter with the letter that sits the same distance from the other end of the alphabet. A becomes Z, B becomes Y, C becomes X, and so on until M becomes N and N becomes M. The same swap is its own reverse. If you run a result through this page again, the letters come back.

The page uses the English alphabet only. Digits, spaces, and punctuation stay where they are. Case stays with the letter: an uppercase H becomes an uppercase S, and a lowercase h becomes a lowercase s. “Hello, World!” becomes “Svool, Dliow!” The comma, the space, and the exclamation mark do not move.

What Atbash Changes

The alphabet is lined up once forward and once backward. The letter in position 1 trades with the letter in position 26. Position 2 trades with position 25. You do not need a key word, a shift number, or a password. The rule is the alphabet itself. That is why the same page both encodes and decodes. There is no second mode to pick.

A letter’s case is kept, but the identity of the letter changes. “A” and “a” both sit in the first position, so both become the last letter, one uppercase and one lowercase. A character that is not an English letter is copied through. “2026” stays “2026”. An accented letter is not in the A-to-Z range this page uses, so it is copied through as well. If your text is not English, the swap will only touch the A-to-Z letters inside it.

The headline counts the letters that were swapped, not the characters that were copied. A sentence with five letters and a comma reports five letters swapped. An empty box, or a box of spaces, is rejected. The page will not call a blank paste a successful decode.

How the Swap Is Applied

Each character is looked at in order. If it is A through Z or a through z, its place in the alphabet is subtracted from 25, counting from zero, and the letter at that new place is written in the same case. If it is anything else, it is written unchanged. The output is one string, the same length as the input.

You can check a single letter without a whole sentence. A becomes Z. Z becomes A. B becomes Y. N becomes M. M becomes N. Those five pairs are enough to see that the middle of the alphabet folds onto itself and the ends trade. A word you know, such as Hello, is the next check. H is eight letters from A, so it lands eight letters from Z, which is S. The rest of Hello follows the same fold and becomes Svool.

A count of sentences is a different job. The Sentence Counter splits text on sentence boundaries. Atbash does not. Periods stay periods, so a decoded paragraph still has the same number of sentence marks it started with. Do not use the letter swap as a sentence count, and do not use a sentence count as a cipher.

A Short Text You Can Recompute by Hand

Take “Abc”. A becomes Z, b becomes y, c becomes x. The result is “Zyx”. Run “Zyx” again and you get “Abc”. The comma in “Abc, 12” survives, and the digits survive, so the full result is “Zyx, 12”. If a tool or a spreadsheet gives you a different string, it is either shifting by a fixed number, which is a Caesar cipher, or it is folding a different alphabet.

Hello with a capital H and the rest lowercase is “Svool”. World with a capital W is “Dliow”. The space between them stays a space. That is the example in the form’s own description. Type it, choose Decode, and compare the box with Svool, Dliow. Then choose Decode on that output and confirm Hello, World comes back, including the comma and the exclamation mark if you included them.

The letter count for “Hello, World!” is 10, because the comma, the space, and the exclamation mark are not letters. The headline should say 10 letters swapped. If it says 13, something is counting punctuation, and that is not this page.

Why the Same Page Decodes

A substitution that pairs letters both ways does not need a reverse table. The partner of A is Z, and the partner of Z is A. Applying the table twice is the identity. That is the property to show a class: encode a line, encode the result, and the line returns. If it does not return, the second pass used a different rule.

Blank lines and paragraph breaks are characters too, and they are not letters, so they survive both passes. If you need to know how many blocks those blank lines create, that is a paragraph question. The Paragraph Counter splits on blank lines. Atbash will not. Leave the breaks in the text if you want them in the decoded copy, and count them on the paragraph page if the count is what you need.

Do not remove the breaks before you decode if the breaks are part of the message’s shape. A single line of letters is a fine Atbash input. A poem with blank lines is also a fine input. The page will not reflow it.

What Stays Put

Digits stay digits. “A1” becomes “Z1”, not a swapped digit. Punctuation stays punctuation. Currency signs, quotes, and parentheses stay. Newlines stay newlines. The copy button copies the decoded string, including those unchanged characters, so a paste back into a document keeps the spacing you had.

There is no key to lose and no key to guess. Anyone who knows the rule can reverse the letters. That is the limitation to say out loud if someone treats the output as a secret. Atbash hides a letter from a quick glance. It does not hide it from a person who tries the alphabet fold. Use it for puzzles, for teaching a substitution, and for checking a worksheet. Do not use it as the only protection for a password or a private message.

The page does not offer a different alphabet. If you need a 26-letter fold, this is that fold. If you need a shift of three, this is the wrong tool, because a shift of three does not send A to Z.

Mistakes That Look like a Different Cipher

Reading A as B is a shift, not Atbash. The first letter of the alphabet must become the last. If a student’s “decode” turns Hello into Ifmmp, they shifted forward by one. Show them Svool and the fold, and have them name the partner of H before they touch the rest of the word.

Stripping spaces before the swap changes the string the copy button will return. Spaces are not letters, so they would have survived anyway. Stripping them is a separate edit. If the goal is one line with the breaks removed, do that on purpose and say so. The Remove Line Breaks tool joins or removes breaks. It does not swap letters. Run Atbash first if you want the letters swapped and the breaks still in place, or second if you want to flatten a result you already trust.

Longer Text

A paragraph and a single word use the same rule. Length does not change the pairing. The headline’s letter count grows with the letters and ignores the rest. A page of prose is a valid input. The output will be the same page with each English letter folded. Reading it will look like nonsense until you fold it back, which is the point of the exercise.

Classroom and Puzzle Uses

Give the class the rule and one word, and ask for the partner of each letter before they see the page. Then run the page and compare. The page is the answer key for the fold, not a mystery. A second pass in front of the class shows that the cipher is reversible without a different key.

Superscripts are a different transformation. The Superscript Generator turns digits and letters into Unicode superscript characters. It does not fold the alphabet. A chemistry notation and an Atbash line solve different problems. Do not send a cipher worksheet through the superscript page and expect A to become Z.

Limits of the English Fold

Languages that use letters outside A to Z are only partly handled. Those extra letters pass through. A message that is mostly accented characters will come back almost unchanged, and the letter count will count only the A-to-Z letters. Say that when the source is not English.

A Fold You Can Finish on Paper

Write the alphabet on one line and the reversed alphabet under it. Read downward. The paper and the page should agree on every column. If they disagree at one column, the paper skipped a letter. The page will not skip. This paper key is worth making once, because every later word is just reading down the columns.

Handing the Fold to Someone Else

When you send a folded line to another person, send the rule in the same message. “English Atbash, letters only” prevents them from treating Svool as a shift. Offer the round trip: they can paste the line into this page and should see your original, if they still have a reason to recover it. If they should not recover it, do not send them the original and do not assume the fold will stop them.

Checking the Fold

Type Hello, World! and confirm Svool, Dliow! Then decode that result and confirm the original, including the comma and the exclamation mark. Type A and confirm Z. Type a digit and confirm the digit. Those checks pin the ends of the alphabet, the case rule, and the pass-through rule.

A made-up sentence is not a check of the cipher. The Random Sentence Generator builds a sentence from stored parts. It will not fold letters and it will not tell you whether Svool is right. Use it when you need a practice sentence, then bring that sentence here if you want it folded.

Frequently Asked Questions

What does Atbash do to the letter A?

A becomes Z, and Z becomes A. The same pairing is used for lowercase a and z.

Why does decoding twice return the original letters?

Each letter’s partner maps back to it. The second pass undoes the first. Punctuation never moved, so it is still there too.

What happens to numbers and spaces?

They are copied unchanged. Only the letters A through Z, in either case, are swapped.

Does Hello become Svool?

Yes. H becomes S, e becomes v, and the two l letters become o. The capital H stays capital.

Is this a Caesar cipher?

No. A Caesar cipher shifts every letter by the same number. Atbash folds the alphabet so the first letter meets the last.

Will accented letters be swapped?

No. Letters outside English A to Z are copied through. The headline counts only the letters that were swapped.

Can I use this to keep a message secret?

Anyone who knows the fold can reverse it. It is a puzzle and a teaching tool, not protection for a password or a private message.

What does an empty box do?

It is rejected. A decode needs text. Spaces alone are not enough.

Does the page store what I paste?

No. The text stays in the browser for that visit. Copy the result if you need to keep it.

Are uppercase and lowercase treated as different letters?

They use the same place in the alphabet, and the result keeps the case you typed.

What does the copy button copy?

The decoded string, including spaces and punctuation that were not letters.

Can I swap a single letter?

Yes. One letter is a valid input. A becomes Z, and the headline reports one letter swapped.