Encode & Decode · Runs in your browser

JSON Stringify

Convert a JSON document into a single quoted string — ready to embed in another JSON value, a test fixture, an environment variable or source code.

JSON
Drop a file to load it
String
Waiting for input

How to use it

  1. Paste valid JSON.
  2. Keep “Minify first” on for a compact one-line string.
  3. Copy the quoted, escaped string.

What it does

The output is the JSON text itself encoded as a JSON string — what JSON.stringify(JSON.stringify(value)) produces in JavaScript.

Going back

Use JSON Unescape to turn the string back into the original document.

Exact numbers

Numbers are written exactly as in your input, so long IDs aren’t rounded on the way.