JSON formatter & validator

Paste JSON on the left, pick an indent level, and click Format to pretty-print or Minify to flatten. The validator reports the exact line and column of any syntax error.

JSON formatter

What's allowed in JSON

  • Strings must use double quotes ("like this"), never single.
  • Object keys are always strings, even if they look numeric.
  • No trailing commas. [1,2,3,] is invalid.
  • No comments. Use a JSON5 parser if you need them.
  • NaN, Infinity, undefined aren't valid JSON values.

FAQ

Does my JSON leave the page?

No. All formatting and validation runs in your browser via the native JSON.parse / JSON.stringify functions.

Why does the error message say a different position than I expected?

The native parser reports the position where it gave up — usually one or two characters past the actual problem (e.g. a missing comma is detected at the next token).

Related calculators