JSON Formatter

Format, Minify and Validate JSON.

Loading…

Paste JSON to see it indented with two spaces, four spaces or tabs, or squeezed to a single line. If it is not valid, the message names the line and says what was unexpected. Keys can be sorted alphabetically to compare two files.

How to use the JSON Formatter tool

  1. Paste JSON or open a .json file in JSON Formatter.
  2. Choose the layout, and tick sorting if you want it.
  3. Copy or download the result in JSON Formatter.

Tips for the best result

  • The usual causes of invalid JSON are a trailing comma and single quotes instead of double.
  • Sort keys in two files before putting them through Text Compare.

Quick facts

PriceFree
Works withJSON
Where it runsIn your browser, on your device
AccountNot needed

Frequently asked questions

Does formatting change my data?

No. Only spaces and line breaks change, unless you ask for keys to be sorted.

Are comments allowed?

Standard JSON has no comments, so a file with them is reported as invalid.