Backslash Escape/Unescape
DeveloperEscape and unescape backslash characters in strings for JSON, JavaScript, regex, and other programming contexts.
Backslash Escape/Unescape
Escape and unescape backslash characters for various contexts
Escape for JSON strings
Quick Reference
More about the Backslash Escape/Unescape
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. 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