Kadben

JSON formatter and validator

Paste JSON or open a file to pretty-print it, put it on one line or just check it. An error is shown with its line and column; numbers and text stay exactly as written.

Runs in your browser. Nothing is uploaded.

JSON formatter and validator

Options

The formatted JSON appears here.

How to use it

  1. Paste JSON into the box, drop a file on it, or select “Open a file”.
  2. Choose the action: format, minify or check only; for formatting also the indentation.
  3. Turn on “Sort keys A–Z” or “JSON Lines” if you need them; the result updates by itself.
  4. Copy the result or download it as a .json file. For an error, select “Show in the text” to go to it.

Rules and limits

How the JSON is written

What is checked

Limits

Questions and answers

Why does my number 12345678901234567890 stay unchanged here?

Because this page never turns numbers into JavaScript numbers: it copies them character by character. Browsers, Node.js and many other programs keep only about 16 significant digits, so the page also tells you which of your numbers they would change.

Is a duplicate key an error?

Not by the standard: RFC 8259 only says that names should be unique, so the JSON is still valid. Most programs then keep just the last value, which is why the page warns you and leaves every copy in the result for you to decide.

Can it read JSON with comments or a comma before the closing bracket?

No: comments, single quotes and trailing commas belong to JavaScript and JSON5, not to JSON, and most programs refuse them. The page shows where the first one is, so you can remove it.

What is JSON Lines?

A file with one JSON value on each line, common for logs and data exports (.jsonl, .ndjson). With the switch on, each line is checked on its own; “Minify” then writes one record per line, “Format” writes the records one after another in readable form.

Related tools