Toolstia / JSON formatter and validator

Format and validate JSON

Paste JSON to make it readable, shrink it to one line, or find out why it is invalid. Errors show the line and column. Your data stays in your browser.

How it works

  1. Paste your JSON.
  2. Choose format or minify, the indent size, and whether to sort keys.
  3. Copy the result or download it as a .json file.

Format and minify

Format adds line breaks and indentation so people can read it. Minify removes all optional spaces, which makes the file smaller for sending over a network.

Finding errors

Typical mistakes are a trailing comma, single quotes instead of double quotes, a missing quote around a key, and comments, which JSON does not allow. The message names the problem and where it is.

Sorting keys

Sorting puts every object key in A to Z order, including nested ones. Array order is never changed.

Privacy

Parsing happens in your browser, so API responses and config files are not uploaded.

Questions

Is my JSON sent anywhere?

No. It is processed in your browser tab.

Why does it say invalid when my program accepts it?

Some programs accept relaxed JSON with comments or trailing commas. Standard JSON does not, and this validator follows the standard.

Does formatting change my data?

No, with one caution: very large numbers beyond JavaScript precision can lose digits when the data is re-written.

Is there a size limit?

No fixed limit, but files of tens of megabytes may be slow in the browser.