JSON Formatter
Format, validate and minify JSON, with errors reported by line and column.
Loading tool…
How to use it
- Paste the JSON.
- Format to pretty-print it, or Minify to strip whitespace.
- Copy the result or download it.
When to use it
- An API response came back as one long line and you need to read the structure.
- You need the exact line and column where parsing failed.
When not to use it
- The JSON is invalid and you want it repaired. The formatter reports the error instead of guessing.
Example
one-line JSON with a trailing comma
pretty-printed output plus the error position
Good to know
- Parsing is strict JSON. Trailing commas and comments are rejected, and the error points to the exact line and column.
- Format uses two-space indentation; Minify strips all whitespace for transport.
- Large documents are displayed truncated for speed, but the downloaded file is always complete.
Questions
Is my JSON sent to a server?
No, parsing happens in the page. Close the tab and the data is gone.
Why does it reject my JSON?
It follows RFC 8259 strictly: trailing commas, single quotes, comments and NaN are all invalid. The error report gives the line and column.
Does Minify change the data?
No. Only whitespace between tokens is removed; key order and values are untouched.
Does it sort keys?
No, insertion order is preserved so the output still matches the input semantics.
How large a file can it handle?
A few MB is comfortable. Beyond that string parsing in the browser gets noticeably slow.