Backslash Escape & Unescape Tool
Escape and unescape backslash sequences for JSON-like strings, regex samples, shell notes, and code literals.
What is this tool?
This backslash escape tool converts special characters into visible escape sequences and reverses common backslash escapes back into characters. It covers backslashes, quotes, apostrophes, newlines, carriage returns, tabs, and null characters.
Backslash escaping is a notation layer used by many syntaxes, but each syntax has its own exact grammar. A string that is acceptable in a JavaScript literal may not be valid JSON, regex, SQL, or shell input without additional escaping.
Use the tool for quick string-literal preparation, log inspection, snapshot cleanup, or understanding what an escaped sequence actually represents.
How to use
- Open Escape to add backslash sequences, or Unescape to interpret existing sequences.
- Paste the text or escaped string into the input area.
- Run the conversion and copy the output.
- Validate the final string in the target language because JSON, JavaScript, shell, and regex escaping rules are not identical.
Examples
| Input / setting | Output | Notes |
|---|---|---|
He said "hi" | He said \"hi\" | Double quotes are escaped for a string literal. |
It's ok | It\'s ok | Apostrophes are escaped as well. |
Related tools & concepts
Last reviewed: 2026-05-08