JSON Formatter/Validator

Format, minify and validate JSON. Pretty-print minified JSON or find the syntax error that breaks it.

Helpful?
0
Keys
0
Values
0
Depth
0
Size

Paste JSON above to format it with consistent indentation, minify it for transport, or simply validate it — the tool reports the parser's error message when the input is not valid JSON. Nothing is uploaded; parsing happens in your browser.

The errors this validator catches

  • Trailing commas after the last item in an object or array.
  • Single quotes instead of double quotes, and unquoted keys.
  • Comments, NaN, Infinity or undefined — none of which exist in JSON.
  • Stray text, a BOM or an empty input ("Expected a JSON object, array or literal").
  • Bad escapes and smart quotes pasted from a word processor.

Each of these is explained, with before/after snippets, in Common JSON errors and how to fix them.

The JSON tool set

Convert CSV to JSON or JSON to CSV, switch to YAML, transform XML to JSON, or turn a plain list into a JSON array. New to the format? Start with JSON explained.

Frequently Asked Questions

It re-indents JSON so nested objects and arrays are easy to read, or strips the whitespace to minify it. Formatting never changes the data, only the layout.

Paste it here. If it parses, it is valid; if not, the tool shows the parser's error message, which usually names the unexpected character and its position.

The parser found nothing it recognises at the start of the input: it is empty, begins with text or a comment, or starts with an invisible byte-order mark. Remove anything before the first { or [.

No. Unlike JavaScript, JSON rejects a comma after the last item in an object or array. Delete the final comma.

No. Formatting and validation run in your browser with JavaScript's built-in parser; the text never leaves your device.

Formatting (beautifying) adds indentation and line breaks for humans; minifying removes all optional whitespace to make the payload smaller for machines. Both represent exactly the same data.
Share this tool