Data / LOCAL TOOL

JSON Stringify & Unstringify

Turn JSON into a JSON string literal or decode a stringified JSON document locally.

Runs locally — input is never uploaded
Paste, type, or drop JSON or a JSON string literal
Ready when you are

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

  1. Paste the document and choose Stringify, or paste a quoted JSON string literal and choose Unstringify.
  2. Choose whether to minify before encoding or pretty-print after decoding, then convert.
  3. 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.

WORKED EXAMPLES

Store an object as a string field

Choose Stringify and convert this object into one JSON string literal. Put that result back into the input and select Unstringify to check the reverse operation.

JSON document

{"answer":42}

Expected result

The encoded value is "{\"answer\":42}". The backslashes escape quotes inside the string; they are not additional object properties. Unstringify recovers the answer as a number.

COMMON QUESTIONS

JSON Stringify questions

What is the difference between stringify and minify?
Minifying removes optional whitespace but leaves a JSON document. Stringifying encodes that complete document as a JSON string value, escaping quotes, backslashes, and line breaks so the result can be stored inside other JSON.
Does unstringify simply remove backslashes?
No. It first parses a valid JSON string literal, then verifies that the decoded string is valid JSON. Invalid quotes or escape sequences produce an error rather than a guessed result.
Is the JSON uploaded while it is converted?
No. Stringifying, unstringifying, validation, formatting, copying, and local file reading all happen in your browser.