JSON Escape/Unescape — Free Online String Tool 2026
JSON Escape converts plain text to a valid JSON string by adding backslash escape sequences for quotes, newlines, tabs, and control characters. JSON Unescape reverses the process — paste a JSON-escaped string and get the original human-readable text back. Both modes run entirely in your browser.
Result
How It Works
- Choose Escape or Unescape mode
- Paste your text in the input field
- Get the processed result instantly
- Copy to clipboard with one click
JSON String Escaping — Complete Guide
JSON string escaping is a mandatory step when embedding arbitrary text inside a JSON document. In JSON, string values are delimited by double quotes, so any double quote character inside the string must be escaped as \". Similarly, newlines become \n, carriage returns become \r, tabs become \t, backslashes become \\, form feeds become \f, and backspaces become \b. Control characters (Unicode codepoints U+0000 through U+001F) that are not covered by the single-character shorthands are encoded as \uXXXX four-digit hex sequences.
Common Use Cases for JSON Escaping
The most common scenario is storing multi-line content as a JSON string value — for example, an HTML template, a SQL query, a regex pattern, or a markdown document stored in a configuration file. JSON does not support multi-line strings (unlike YAML or TOML), so newlines must be encoded as \n. When you need to work with the JSONPath structure of that same configuration file, use the JSONPath Finder to navigate to the correct field. If the JSON file itself has errors introduced during manual editing, the JSON Repair tool can fix them before you paste the value here.
Escape Sequence Reference
| Character | JSON Escape | Description |
|---|---|---|
" | \" | Double quote |
\ | \\ | Backslash |
| newline | \n | Line feed (LF) |
| tab | \t | Horizontal tab |
| carriage return | \r | Carriage return (CR) |
| U+0000–U+001F | \uXXXX | Control characters |
| emoji (e.g. 😀) | 😀 | Surrogate pair |
Unescape — Reading JSON String Values
When you receive JSON from an API and need to read the raw content of a string field, the JSON parser in your language automatically decodes escape sequences. But if you have manually extracted a quoted string value — for example by copying from a log file — and it contains literal backslash sequences, this tool decodes them into the original text. It is also useful for debugging: if your API response stores a nested JSON object as a string (a common anti-pattern), you can unescape it here to read the content, then use the JSON Formatter to beautify the inner JSON.
Frequently Asked Questions
JSON escape converts a plain text string into a valid JSON string value by adding backslash sequences: double quotes become \", newlines become \n, tabs become \t, backslashes become \\, and control characters become \uXXXX. The result can be embedded as a string value inside a JSON document.
JSON unescape decodes a JSON-escaped string back to its original readable form. It interprets \n as a newline, \t as a tab, \" as a double quote, \\ as a backslash, and \uXXXX as the corresponding Unicode character.
You need to escape a string when embedding it as a value inside a JSON document you are building by hand, when storing multi-line text like templates or SQL queries in JSON config files, or when a string contains special characters that would otherwise break JSON syntax.
Yes. Emoji and characters outside the Basic Multilingual Plane are encoded as surrogate pairs 𐀀 in the escaped output, which is fully compliant with the JSON specification and handled correctly by modern parsers.
Comments