JSON Formatter

JSON formatter and validator

Format, minify and validate JSON.

Runs on this deviceJSON
Input
or drop a file below
Ctrl ↵ Add to workflow

More in Developer

About JSON Formatter

Paste JSON and this tool reformats it with the indentation you choose, minifies it onto one line, or just checks that it is valid. It can also sort object keys alphabetically. The work happens on your device, so API responses and config files are not sent anywhere.

How to use JSON Formatter

  1. Paste your JSON into the input box, or drop a .json file on it.
  2. Choose Format, Minify or Validate.
  3. For Format, pick 2 spaces, 4 spaces or tabs, and switch on key sorting if you want it.
  4. Copy the result or download it.

Questions and answers

Does it check that my JSON is valid?

Yes. If the text cannot be parsed you get the parser's error message instead of output.

Is my JSON uploaded to a server?

No. The tool runs in your browser or the desktop app, so the text stays on your device.

What does sorting keys do?

It reorders the keys of every object alphabetically, which makes two JSON files easier to compare. Array order is not changed.

Can it handle comments or trailing commas?

No. It follows strict JSON, so JSON with comments or trailing commas is reported as invalid.

Related tools