Example input/output
Input: She said "hello" and it's fine
Output: She said \"hello\" and it\'s fine
How it works
This tool escapes backslashes, single quotes, double quotes, and control characters (\n, \r, \t) with the appropriate JavaScript escape sequences. Processing runs in your browser.
Common use cases
- Escape backslashes and quotes in strings for safe inclusion in JavaScript code
- Prepare text for use in JSON string values
- Debug string encoding issues in JavaScript applications