ROT13 Encoder and Decoder
Convert text to ROT13 and back instantly 🔄 100% free, fast, and secure 🔐 Try it now 🚀
Convert text to ROT13 and back instantly 🔄 100% free, fast, and secure 🔐 Try it now 🚀
A ROT13 Encoder / Decoder is a text transformation tool that applies a simple letter substitution cipher known as ROT13, which stands for “Rotate by 13 places.” It replaces each letter in the English alphabet with the letter that appears 13 positions after it. If the end of the alphabet is reached, it wraps around to the beginning.
For example, the letter A becomes N, B becomes O, and C becomes P. Similarly, N becomes A, O becomes B, and P becomes C. Because the English alphabet contains 26 letters and 13 is exactly half of 26, applying ROT13 twice returns the original text. This means the same tool works for both encoding and decoding.
The ROT13 algorithm works by shifting alphabetic characters forward by 13 positions. The formula for each letter can be described as: New Position = (Original Position + 13) mod 26. This ensures the shift stays within the alphabet range.
For example, if we assign A = 0, B = 1, C = 2, and so on, the letter C (position 2) becomes P because (2 + 13) mod 26 = 15, and the 15th letter is P. If we apply the formula to T (position 19), we get (19 + 13) mod 26 = 6, which corresponds to G.
Non-alphabetic characters such as numbers, spaces, and punctuation remain unchanged. Uppercase and lowercase letters are preserved in their respective cases, ensuring the output maintains proper formatting.
ROT13 is commonly used for light text obfuscation. It allows users to hide spoilers, puzzle answers, or sensitive jokes in forums and discussion boards without fully encrypting the message. Readers who want to reveal the message can simply apply ROT13 again.
Developers and programming students often use ROT13 to understand basic cipher logic and modular arithmetic. Because it is simple and symmetrical, it serves as a good introduction to substitution ciphers.
It is also used in coding exercises, cybersecurity training demonstrations, and text-based games where reversible encoding is required without complex encryption systems.
Step one: identify whether the character is an uppercase or lowercase letter. Step two: convert the character to its alphabetical index (A–Z or a–z). Step three: apply the formula (Index + 13) mod 26. Step four: convert the resulting index back to a letter while preserving case.
Because ROT13 is symmetrical, the same process is used for decoding. Applying the shift once encodes the message, and applying the shift again restores the original text. Mathematically, this works because: (Index + 13 + 13) mod 26 = Index mod 26.
In JavaScript or similar programming logic, this is typically implemented by looping through each character, checking its ASCII code range, adjusting it using modular arithmetic, and rebuilding the transformed string. Characters outside A–Z and a–z remain unchanged for accuracy and readability.
Is ROT13 encryption secure?
No. ROT13 is a simple substitution cipher and does not provide real cryptographic security. It is intended for basic text obfuscation only.
Why does applying ROT13 twice restore the original text?
Because shifting by 13 twice equals a full 26-letter rotation, which returns each letter to its starting position.
Does ROT13 affect numbers or symbols?
No. Only alphabetic characters are transformed. Numbers, punctuation, and spaces remain unchanged.
Can this tool handle uppercase and lowercase letters?
Yes. The tool preserves the original case while applying the 13-letter shift.
Is my input stored?
No. All ROT13 conversions are processed locally in your browser without saving any text.