JSON Stringify
Explore JSON.stringify() output with indent options, string literal wrapping, and a reverse parse mode
Shortcuts: Ctrl+Enter run · Ctrl+L clear · Ctrl+D download
About JSON Stringify
This tool shows exactly what `JSON.stringify()` produces for your input, with control over the indentation level and optional string-literal wrapping for embedding in JavaScript source code. A reverse "parse" mode lets you paste a stringified JSON string and see the parsed object — useful for debugging doubly-encoded JSON in logs or API responses.
- ✓Shows raw JSON.stringify() output with configurable indent levels (0, 2, 4)
- ✓String-literal mode wraps the output in quotes and escapes it for pasting into JavaScript code
- ✓Reverse mode: paste a stringified JSON string to parse and display the original object
- ✓Useful for debugging doubly-stringified JSON and log output
Stringify vs Parse: Turning JSON into a String and Back
Sometimes JSON has to travel as a string inside something else: a value in another JSON document, a string literal in source code, an environment variable, a database text column, or a message queue payload. JSON.stringify produces that string; JSON.parse turns it back into data. This tool runs both directions in the browser using exactly those built-in functions.
Stringify mode
Paste valid JSON and choose an indent: Compact for the smallest output, or 2 or 4 spaces for readable output. With "Wrap as string literal" enabled, the result is stringified a second time, producing a quoted, escaped string you can paste directly into code or into another JSON document as a value.
Input: { "user": "ada", "admin": true }
Compact: {"user":"ada","admin":true}
As string literal: "{\"user\":\"ada\",\"admin\":true}"Parse mode
Paste a stringified value, including its surrounding quotes and escaped characters, and get readable, formatted JSON back. Plain unescaped JSON works too. This is the everyday use: decoding a payload that a log line, a webhook, or a database column stored as one long escaped string.
Input: "{\"event\":\"signup\",\"plan\":\"pro\"}"
Output: {
"event": "signup",
"plan": "pro"
}The double-encoding bug
A very common bug is a value that gets stringified twice: the code calls JSON.stringify on data that was already a string, and the receiver sees "{\"a\":1}" instead of an object. Running the value through Parse mode once and seeing another quoted string as the result is a quick way to confirm this is what happened. The fix is to remove the extra stringify call at the source, not to parse twice on the receiving side.
What JSON.stringify drops
- ·undefined values and functions are omitted from objects (and become null inside arrays)
- ·NaN and Infinity become null
- ·Date objects become ISO 8601 strings and do not turn back into dates when parsed
- ·Map, Set and class instances lose their type, and BigInt values throw an error
Those rules only matter when stringifying live JavaScript values in your own code; data pasted into this tool is already JSON, so nothing is lost here.
Tip: For escaping a single piece of text rather than a whole JSON document, use the JSON Escape tool.