Example input/output
Input: She said "hello"\nand it's fine
Output: She said \"hello\"\nand it\'s fine
How it works
This tool escapes Python string special characters including backslash, single quote, double quote, newline, tab, carriage return, and null byte. Processing runs in your browser.
Common use cases
- Escape backslashes and special characters in Python string literals
- Prepare raw strings for inclusion in Python source code
- Debug encoding issues in Python scripts