ToolKit

03 / DEVELOPER

JSON Formatter

Pretty-print, minify and validate JSON in your browser. Detects syntax errors with line and column hints. Nothing leaves your device.

Input
Output

How to use

  1. 1Paste your JSON into the Input panel on the left.
  2. 2The Output panel renders the formatted result as an interactive tree with line numbers in a left gutter. Indent defaults to 4 spaces; switch to 2 with the indent control.
  3. 3Click the toggle on any object or array to collapse it, or use the panel's Collapse all / Expand all buttons.
  4. 4Click Minify to collapse the JSON onto a single line, or Format to switch back to the tree view.
  5. 5If your input is invalid, the error bar shows the failure with the offending line and column.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting use your browser's native JSON.parse and JSON.stringify. Nothing leaves your device.

How do I read the error message?

We pass through the browser's parser error and append the line and column inferred from the byte position, e.g. "Unexpected token } at position 28 (line 4, col 12)".

Can it handle very large JSON?

Inputs up to a few megabytes work fine. Beyond that you may notice a delay; the format runs synchronously, so the page is briefly blocked while parsing.

Are JSON5, JSONC or trailing commas supported?

Yes — switch the parser toggle to Lenient. The lenient mode runs json5 and accepts comments, trailing commas, single-quoted strings, hex numbers, and the rest of the JSON5 spec. Strict mode (default) keeps to the JSON RFC.

Related tools