Backslash Escape/Unescape
Escape and unescape backslash characters in strings for JSON, JavaScript, regex, and other programming contexts.
Enter text above to escape for json context
The same backslash means something different depending on what it's headed into next, a JSON string needs one level of escaping, but a string destined to become a regex pattern often needs two, once for the string literal itself and again because regex uses backslash for its own escape sequences, and getting that escaping level wrong by one is a genuinely common, hard-to-spot source of a broken pattern. This tool escapes and unescapes backslash characters for JSON, JavaScript, regex, and other programming contexts, applying the right escaping level for whichever destination the string is actually headed toward.
See moreSee less about the Backslash Escape/Unescape
Useful for escaping a string correctly before it gets embedded inside a regex pattern rather than just a plain string literal, unescaping a backslash-heavy string copied from a log file back into its original readable form, or checking exactly how many backslashes a specific context actually requires before pasting a string into code.
Key features
- Clean interface
- Fast processing
- No signup required
- Works offline