Python String Escape / Unescape
Escape arbitrary text to a Python string literal — \x, \u, \U, octal — or decode one back to raw text.
Python string literal
What gets handled
- Standard escapes —
\n \t \r \v \f \a \b \0 \' \" \\ - Hex (
\xHH) and octal (\OOO) - Unicode —
\uXXXXand\UXXXXXXXX - Named —
\N{LATIN SMALL LETTER A}preserved verbatim (no Unicode DB lookup) - Raw-string mode (
r"…") — escapes pass through unchanged
You might also like
- SQL Escape / UnescapeSafely quote string literals for ANSI, MySQL, or PostgreSQL — and reverse it.
- Escape / UnescapeEscape or unescape strings for JSON, JavaScript, HTML attribute, XML, and SQL contexts.
- AES Encrypt / DecryptEncrypt or decrypt text with AES-GCM, deriving a key from a passphrase via PBKDF2 — all in your browser.
- Base64 Encoder / DecoderEncode or decode Base64 strings instantly.