JSON Formatter

Messy in.
Readable out.

Indent
Output

To format JSON, paste it into the Input box and press Format; choose 2 spaces, 4 spaces or tabs for indentation. Minify removes all whitespace, and Validate checks the JSON and shows the exact line and column of any error.

How to format and validate JSON

  1. Paste your JSON into the Input box.
  2. Press Format to beautify it, or Minify to compress it into one line.
  3. If the JSON is invalid, the error tells you what is wrong and the exact line and column.
  4. Press Copy to copy the result.

Frequently asked questions

Why is my JSON invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, and comments — none of which are allowed in JSON. The validator points to the exact line and column.
What is the difference between formatting and minifying JSON?
Formatting (beautifying) adds line breaks and indentation so JSON is easy to read. Minifying removes all unnecessary whitespace to make the file as small as possible for sending or storing.
Is my JSON sent anywhere?
No. Formatting and validation run in your browser with JavaScript, so your data — including API keys or personal data inside it — never leaves your device.