Skip to content
knitsapp

JSON formatter and validator

Developer

Paste or open JSON to format, minify, validate and explore it as a tree.

Output

Paste JSON or open a file. It is checked as you type, and nothing leaves your device.

How it works

Format, minify and validate JSON in your browser. Exact error line and column, sort keys, a keyboard-friendly tree with node paths. Nothing is uploaded.

  1. Paste your JSON or open a .json file.
  2. Pick Format or Minify, then fix any error shown with its line and column.
  3. Copy the result or download it as a .json file.

Questions

Is my JSON uploaded anywhere?

No. Parsing, formatting and the tree all run in your browser, in a background script loaded from this site. The text is never sent to a server.

How does it find the error position?

When the JSON is invalid, a strict scanner reports the exact line and column of the first problem, with a short explanation such as a trailing comma, single quotes or a missing comma. Columns count characters, so an emoji counts as one.

Can it handle large files?

It is built to handle files of a few megabytes. The work runs in the background, so the page stays responsive, but a large file can take a few seconds and a Working note shows until it is done. If a file takes over 10 seconds it is stopped and you can try again. Above about 1 MB a Large file notice appears. The tree shows at most 2,000 rows at a time; use the Text view to see everything. The Text view shows the first 200 KB of a very large result; Copy and Download always give the full result.

Does sorting keys change my data?

Sort keys only changes the order of keys inside objects, A to Z by character code. Arrays keep their order. Keys that look like whole numbers are always listed first by JavaScript, in numeric order.

Are very large numbers kept exactly?

No. Numbers are read as JavaScript numbers, so an integer beyond 9007199254740991 or a very long decimal can be rounded in the result. Keep such values as strings if they must stay exact.

More in Developer