String Escape / Unescape
Escape or unescape strings for JSON, JavaScript, SQL, and Regex in your browser. Toggle between encode and decode modes. No data leaves your device.
Input
Escaped
Related Tools
JWT Decoder
Decode JWT tokens instantly. Inspect header and payload client-side — your token never leaves the browser.
Unix Timestamp
Convert Unix timestamps to UTC, local time, and ISO 8601 instantly. Auto-detects seconds vs milliseconds.
Base Converter
Convert numbers between decimal, hex, binary, and octal instantly. Free and runs in your browser.
Advertisement
How to Use
- Paste your string into the input panel.
- Select the escape mode: JSON, JavaScript, SQL, or Regex.
- Toggle the direction between Escape (raw → escaped) and Unescape (escaped → raw).
- The result appears instantly in the output panel.
- Click Copy Output to use the result in your project.
Escape Mode Reference
- JSON — Escapes
"→\", backslash →\\, newlines →\n, tabs →\t. Used when embedding strings in JSON values. - JavaScript — Same as JSON but also escapes single quotes and template literal backticks. Used for JS string literals.
- SQL — Escapes single quotes as
''(doubled). Used to safely embed values in SQL queries. - Regex — Escapes metacharacters:
. * + ? ^ $ | ( ) [ ] { } \. Used to treat a string as a literal pattern.
Common Use Cases
- Embedding user-generated text inside JSON API payloads
- Building dynamic SQL queries safely (always prefer parameterized queries)
- Constructing regex patterns from literal strings
- Debugging escaped strings by unescaping them for readability