Skip to content

ROT13 Encoder / Decoder

Embed

Paste this where you want ROT13 Encoder / Decoder on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/rot13-encoder/" width="100%" height="500" frameborder="0" loading="lazy" title="ROT13 Encoder / Decoder"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/rot13-encoder/">ROT13 Encoder / Decoder</a> by BrowserUtils</p>

Apply ROT13 cipher to text.Runs in this tab.

ROT13 is its own inverse — encoding and decoding are the same operation.

How to use ROT13 Encoder / Decoder

  1. Paste text into the Text panel. The ROT13 panel updates immediately. There is no encode or decode switch.
  2. Paste the result back into Text to recover the original. Letters move 13 places. Digits and punctuation stay put.

ROT13 in the browser, in Linux, and in Python

ROT13 shifts each English letter 13 places. The alphabet has 26 letters, so the same shift returns the original. There is no mode switch on this page for that reason.

Hello, World! becomes Uryyb, Jbeyq!. Paste Uryyb, Jbeyq! and you get Hello, World! again. The comma, space, and exclamation mark never move. Digits stay. Letters outside A-Z and a-z stay.

That is Caesar shift 13. The Caesar cipher opens on shift 13 and lets you pick any other shift from 1 to 25.

Is ROT13 encoding or encryption?

ROT13 is encoding. Anyone who can read the alphabet can reverse it, because the shift is fixed and public. Encryption needs a secret that is hard to guess. Do not use ROT13 to hide a password, a token, or anything else you need to keep private.

Decrypt ROT13 in Linux

tr does the same map. It encodes and decodes, because the transform is its own inverse:

echo 'Uryyb, Jbeyq!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'

That prints Hello, World!.

ROT13 in Python

In Python 3, rot_13 is a text codec. Use codecs, not str.encode:

import codecs
codecs.encode('Hello, World!', 'rot_13')  # 'Uryyb, Jbeyq!'
codecs.decode('Uryyb, Jbeyq!', 'rot_13')  # 'Hello, World!'

'Hello, World!'.encode('rot_13') raises LookupError: 'rot_13' is not a text encoding; use codecs.encode() to handle arbitrary codecs.

Next step

Questions

Is ROT13 encoding or encryption?
ROT13 is encoding. It shifts each English letter 13 places, and the same shift brings the text back. Encryption needs a secret that is hard to guess. ROT13 has no secret, so do not use it to hide anything you need to keep private.
How to decrypt ROT13 in Linux?
ROT13 is its own inverse, so the same tr command encodes and decodes. echo 'Uryyb, Jbeyq!' | tr 'A-Za-z' 'N-ZA-Mn-za-m' prints Hello, World!
How do I do ROT13 encoding in Python?
Python 3 treats rot_13 as a text codec. import codecs, then codecs.decode('Uryyb, Jbeyq!', 'rot_13') returns Hello, World!. codecs.encode('Hello, World!', 'rot_13') returns Uryyb, Jbeyq!. str.encode('rot_13') raises LookupError because rot_13 is not a bytes encoding.
Is there a separate ROT13 decoder?
The same box decodes. Hello, World! becomes Uryyb, Jbeyq!, and running that again returns Hello, World!. That shift is also Caesar cipher shift 13. The Caesar cipher tool on this site lets you pick any other shift.

More in Encoding & Decoding

All 20 encoding & decoding