WHAT IT DOES
Move cleanly between JSON text and a JSON string value.
Stringify validates a JSON document and encodes its complete text as one standards-compliant JSON string literal, including every required quote, backslash, and newline escape. Unstringify performs the reverse operation only when the input is an actual JSON string value and the decoded text is itself valid JSON, so malformed escaping is reported instead of being guessed away.
Why use it?
Use it when a JSON document must live inside another JSON string, such as a request field or test fixture. Hand-added backslashes make it easy to escape the same content twice.
How to use this tool
- Paste the document and choose Stringify, or paste a quoted JSON string literal and choose Unstringify.
- Choose whether to minify before encoding or pretty-print after decoding, then convert.
- For example, an object with an answer of 42 becomes one quoted string containing escaped property quotes. Unstringify should recover the object; a string containing plain prose is not a JSON document.
Details and limitations
- Minify before stringify removes insignificant whitespace from the JSON document before its text is encoded.
- Pretty-print after unstringify formats the decoded JSON with two-space indentation; turning it off preserves the decoded text exactly.
- Objects, arrays, strings, numbers, booleans, and null are all accepted as valid JSON documents.
- Local .json and .txt files up to 10 MiB can be dropped directly onto the input pane.