JSON Formatter & Validator Online
Paste JSON to validate and pretty-print it with 2-space indentation. Escaped objects and arrays—including double-stringified JSON—are expanded automatically when you select Format JSON. Everything runs in your browser, and nothing is uploaded.
Good to know: This tool changes string values whose content is a JSON object or array into structured values. If you only want whitespace changes, review the formatted output before copying it.
How it works
Paste or type JSON into the left pane. Plain, escaped, and double-stringified JSON are accepted.
Select Format JSON to validate the input, expand encoded objects and arrays, and pretty-print the result in a background worker.
Copy the formatted result from the right pane.
Common uses
- Making an API response or webhook payload readable before debugging it
- Unescaping a JSON string field that itself contains stringified JSON, from logs or a database export
- Validating a JSON config or fixture file before committing it
- Turning a single-line JSON blob copied from a terminal into something reviewable
How JSON formatting and unescaping work
The pasted text is parsed as JSON, then checked recursively. A string value containing an encoded object or array is expanded in place, through up to 20 layers of string encoding. The result is pretty-printed with 2-space indentation.
Plain JSON just formats
Valid JSON with no encoded objects or arrays is parsed and re-serialized. Duplicate object keys follow browser parsing rules, and equivalent number notation may be normalized.
Encoded strings are expanded
A string field whose content is itself an object or array (as JSON text) is parsed and replaced with the real structure, not left as an escaped string.
Ordinary strings are left alone
A string that happens to look numeric or boolean, like "42" or "true", is never reinterpreted as a different type — only strings that resolve to an object or array are unescaped.
Frequently asked questions
Does this upload my JSON anywhere?
No. Parsing and formatting run entirely in your browser using the native JSON.parse and JSON.stringify. Nothing is sent to a server.
What is escaped or double-stringified JSON?
It is a string whose content is an encoded JSON object or array, often found in API logs, webhook payloads, and database exports. This tool can expand up to 20 layers of string encoding.
Will it accidentally convert a plain string field, like a numeric ID?
No. A string is only unescaped if it resolves all the way to an object or array. A string like "42" or "true" parses to a plain number or boolean, not a container, so it's left exactly as it was.
Does this support JSON5 or JSONC, like trailing commas or comments?
No. It accepts strict JSON and one common CSV or database export pattern that doubles quotation marks inside encoded JSON. Trailing commas, comments, single-quoted strings, and unquoted keys are reported as invalid.
What happens with invalid JSON?
The browser's JSON parser error is shown in the output pane. Depending on the browser, it may include the unexpected token, line, column, or character position.
Is there a size limit?
There is no fixed character limit. Very large input is bounded by the memory available to your browser and may fail if the tab cannot allocate enough. Formatting runs in a background worker to keep parsing work off the interface thread.