Skip to content
BEAD

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 — \uXXXX and \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