About JSON Formatter

JSON Formatter and Validator pretty-prints JSON with a 2-space, 4-space, or tab indent, minifies it to one line, and can sort object keys recursively. Invalid JSON is reported with the parser's message and a best-effort line and column.

Everything runs in the page. Nothing you paste is uploaded.

How to use it

  1. Paste JSON into the input box.
  2. Choose an indent and, if you want, sort the keys.
  3. The formatted JSON appears on the right; Minify collapses it.
  4. Copy or download the result.

Common questions

Does sorting keys change array order?

No. Keys are sorted recursively inside objects; arrays keep their order.

Why is the error line sometimes approximate?

Browsers word the parser error differently and do not all report a position, so the line and column are a best effort.

Is my JSON uploaded?

No. Parsing and formatting run in JavaScript in the open tab.

What does the status line mean?

For valid JSON it summarises the structure: how many objects and arrays, and the deepest nesting level.