JSON Escape
Escapes or unescapes a JSON string, replacing characters that could prevent parsing with their escape sequences.
Loading tool...
JSON string escaping explained
Why escape?
Every string in a JSON document is delimited by double quotes. RFC 8259 forbids unescaped double quotes, backslashes and control characters (U+0000 through U+001F) inside strings.
Rules applied
| Character | Escaped as |
|---|---|
| Backspace | \b |
| Form feed | \f |
| Newline | \n |
| Carriage return | \r |
| Tab | \t |
| Double quote | \" |
| Backslash | \\ |
| Other control chars | \u0000 ... \u001F |
| Forward slash (optional) | \/ |
| Non-ASCII (optional) | \uXXXX (surrogate pairs for emoji) |
Single quotes are never escaped: \' is actually invalid JSON.