JSON Formatter

Format, validate and minify JSON, with errors reported by line and column.

Loading tool…

How to use it

  1. Paste the JSON.
  2. Format to pretty-print it, or Minify to strip whitespace.
  3. Copy the result or download it.

When to use it

When not to use it

Example

one-line JSON with a trailing comma

pretty-printed output plus the error position

Good to know

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.