ENCODING WORKSPACE
JSON String Escape / Unescape
Turn text into a quoted JSON string, or decode one JSON string literal.
Input is processed on this site only when you run the tool. The application does not save inputs or results.
input.txt
Result result.txt
A little clarity goes here.
Run the tool to see your result.
Result preview
UTF-8 text, at most 65536 bytes per input. Tab leaves the editor. Plain text disables syntax colors. Browser textareas may normalize line endings to LF.
{"escape":{"inputMode":"text","options":[],"inputLabels":{"input":"Text to escape"}},"unescape":{"inputMode":"text","options":[],"inputLabels":{"input":"Quoted JSON string"}}}{"escape":{"input":"Hello \"developer\"\nNext line","options":[]},"unescape":{"input":"\"Hello \\\"developer\\\"\\nNext line\"","options":[]}}A QUICK WALKTHROUGH
A familiar workflow,
with room to focus.
Choose Escape for plain text, or Unescape for one complete quoted JSON string.
Paste your text and run explicitly. Quotes around the result belong to the JSON string literal.
Copy or download the result. Move output to input only when you want another explicit conversion.
When to use JSON String Escape / Unescape
Prepare text for one JSON string value, or read an escaped string copied from a log or configuration file.
Read the result
Escape returns a complete quoted string literal. Unescape decodes one string once; it does not recursively parse an embedded document or accept JavaScript escape syntax.
SEE IT IN PRACTICE
Worked examples
Sample input. A result you can inspect.
Escape example
Text to escape
Hello "developer" Next line
Expected result
"Hello \"developer\"\nNext line"
Unescape example
Quoted JSON string
"Hello \"developer\"\nNext line"
Expected result
Hello "developer" Next line
Formats, limits and common errors
For Unescape, include the opening and closing double quotes. Use valid JSON escapes; a literal newline inside a quoted JSON string must be escaped.
- Escape adds surrounding quotes and escapes quotes, backslashes and control characters. Valid Unicode and forward slashes remain literal.
- Unescape requires one JSON string value, including its surrounding quotes. Objects, arrays, numbers, comments, invalid surrogates and trailing data are rejected.
- One decode pass only. This is JSON string syntax, not JavaScript execution, HTML escaping or automatic JSON repair.
- Each input is at most 64 KiB. The browser editor may normalize CRLF to LF; the API preserves supplied text.
- Input ceiling: 65,536 UTF-8 bytes; individual fields may have narrower limits shown above. Output: at most 524,288 UTF-8 bytes; serialized responses have a separate 1 MiB ceiling. Size/work failures return no partial result.