JSON Formatter & Validator

Format, validate and minify JSON instantly. Errors point to the exact line and column.

Was this tool helpful?

How to use the JSON Formatter

  1. 1Paste your JSON.
  2. 2Click Format or Minify.
  3. 3Fix any errors shown, then copy or download the result.

Common JSON errors

Trailing commas after the last item, single quotes instead of double quotes, unquoted property names and comments are not allowed in standard JSON. The validator shows the line and column of the first problem so you can fix it quickly.

JSON vs JavaScript objects

RuleJSONJavaScript
Key quotesDouble quotes requiredOptional
StringsDouble quotes onlySingle, double or backticks
Trailing commasNot allowedAllowed
CommentsNot allowedAllowed
Valuesstring, number, boolean, null, object, arrayAlso undefined, functions, dates…

Pretty print or minify?

Pretty-printed JSON (2-space indent) is easiest to read and review. Minified JSON removes all whitespace and can be 10–30% smaller, which matters for APIs and config files sent over the network. Both contain exactly the same data.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen locally in your browser, which makes it safe for API keys and private data.

Can it sort keys?

Yes. Turn on 'Sort keys' to order object keys alphabetically, which makes JSON easier to compare.