JSON String Escape/Unescape
Turn text into one valid JSON string literal, or decode one JSON string literal without parsing a whole document.
Loading JSON String Escape/Unescape...
How to use
Escape creates a double-quoted JSON string literal. Unescape requires exactly one valid quoted JSON string and restores its newlines, quotes, backslashes, and Unicode.
Example
Input
Line 1
"مرحبا"
Output
"Line 1\n\"مرحبا\""
Limitations
This handles one string value only. Objects, arrays, numbers, comments, and JavaScript escape extensions are rejected when unescaping.
Frequently Asked Questions
Why does escaped output include quotation marks?
The quotation marks make the result a complete, valid JSON string literal that can be placed where a JSON string value is expected.
Are Unicode letters converted to \u escapes?
By default JSON preserves Unicode characters directly. Enable ASCII-only escapes when an older ASCII transport requires them.