Python ROT13 syntax and behavior
In Python, ROT13 is a text-to-text codec: codecs.encode(text, 'rot_13'). Applying the transform twice restores the original text. It rotates only the 26 basic Latin letters; digits, punctuation, whitespace, and non-Latin characters pass through unchanged.
import codecs
encoded = codecs.encode('Hello, world!', 'rot_13')
decoded = codecs.encode(encoded, 'rot_13')
What runs on this page
The live result is produced by a browser-side JavaScript equivalent, not by a Python interpreter. For ordinary ROT13 text it mirrors the relevant letter rotation and updates after typing or paste. It does not exercise Python's codec registry, error handlers, package environment, or version-specific runtime behavior.
- ROT13 is reversible obfuscation, not encryption or password protection.
- Input and output remain in the browser.
- For authoritative runtime behavior, compare with the Python codecs documentation.