Encode or decode a string using the ROT13 cipher, where the same operation is used for both encoding and decoding.
Code
Utilitiesstr.replace(/[a-zA-Z]/g, c => String.fromCharCode((c <= 'Z' ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26));Parameters
The string to encode/decode.
Browser·fetch() may be limited by CORS
More JavaScript Snippets
Base64 to Bytes
Convert a base64 encoded string to a byte array for binary data processing.
Binary to String
Convert a binary string representation to human-readable text.
Bytes to Base64
Convert a byte array to a base64 encoded string for safe text transmission.
Bytes to String
Convert a byte array to a UTF-8 encoded string using TextDecoder.
Decode Base64
Decode a Base64 encoded string back to its original text representation.
Decode URL
Decode a URL-encoded string back to its original form.