JSON Formatter, Validator & Minifier

Free online JSON formatter, validator and minifier — pretty-print JSON with 2 or 4 spaces, catch syntax errors with line hints, all in your browser.

Validate, beautify or minify JSON

Paste any JSON and hit Format to pretty-print it with your chosen indentation, or Minify to strip all whitespace for payloads and config files. Invalid JSON shows the parser error with a line and column hint so you can fix it fast. Parsing happens entirely in your browser — your data never leaves the page.

Common JSON gotchas

  • Keys and strings must use "double quotes", never single.
  • No trailing commas after the last item of an object or array.
  • NaN, Infinity and undefined are not valid JSON values.
  • Comments aren't part of the JSON spec.

Frequently asked questions

Why is my JSON invalid?

The usual suspects: single quotes instead of double quotes, a trailing comma after the last item, unquoted keys, comments (not allowed in JSON), or values like undefined/NaN. Hit Format and the error message points you to the line and column.

Is my JSON uploaded to a server?

No. Parsing, formatting and minifying all happen in your browser with JavaScript's built-in JSON engine — your data never leaves the page, so it's safe for sensitive payloads.

What is the difference between formatting and minifying?

Formatting pretty-prints with indentation for humans; minifying strips every unnecessary space and newline for machines — smaller payloads, faster transfers. Both produce byte-identical data when parsed.

Is there a size limit?

Only your browser's memory. Multi-megabyte JSON files format fine on a typical laptop.

Related tools