Paste JSON below to check it as you type. Format adds readable indentation, Minify removes every optional space, and any syntax error is reported with the line and column where it occurs. Everything runs locally in your browser.
Input
Output
Formatted JSON appears here.
Tip: press Ctrl + Enter (or Cmd + Enter) to format. Minify before putting JSON into a token, header or URL.
How validation works
Validation uses the browser's built-in JSON.parse, the same strict parser used by JavaScript engines. It rejects everything the JSON specification does not allow: single quotes, unquoted keys, comments, trailing commas, and the non-standard values NaN and Infinity. When parsing fails, the browser's message is translated into a line and column so you can jump straight to the problem.
Formatting without changing your data
Format and Minify rewrite whitespace only, and only outside string values. Key order, duplicate keys, escape sequences and the exact digits of every number are kept, so long IDs and high-precision values are not silently rounded by a parse-and-reserialize round trip.
Common questions
Why is my JSON invalid even though it looks correct?
The usual causes are a trailing comma before } or ], single-quoted strings, unquoted keys, a comment, or a smart quote pasted from a document. JavaScript allows these; JSON does not. Paste the document here and the error reports the first offending line.
Is a BOM or Windows line ending a problem?
CRLF line endings are fine. A UTF-8 byte order mark at the very start is not valid JSON for most parsers, including JSON.parse; remove it if the first error points at character 1.
What about duplicate keys or very large integers?
The JSON specification says names should be unique but does not treat duplicates as a syntax error, so JSON.parse accepts them and keeps the last value; Format shows every occurrence so you can spot the duplicate. Numbers are printed exactly as typed. Values beyond 2^53 can lose precision once a JavaScript program parses them, but this formatter does not parse-then-print, so it does not introduce that loss itself.
Can I format JSON with comments or trailing commas?
No. That syntax belongs to JSONC or JSON5, not JSON. Strip the comments and trailing commas first; this tool deliberately accepts only strict JSON so that what it approves will also parse in production.