JSON Formatter & Validator

Validate, beautify, minify, repair, diff and convert JSON. With tree view, JSONPath picker, search and file drop. Everything runs in your browser.

Input -
Drop JSON file to load
Output -

          
- size - nodes - depth - arrays - objects - strings - numbers
Path: -

Paste JSON in the Format tab, then click "Build tree".

JSON input

          
Converted output

          
+ added − removed ~ changed
A (original)
B (new)

Keyboard shortcuts

Ctrl+Enter Format
Ctrl+M Minify
Ctrl+R Repair
Ctrl+K Sort keys
Ctrl+Shift+C Copy output
Esc Clear errors

How to use

  1. Paste your JSON document into the editor.
  2. Press Format to indent and beautify, or Minify to compact it onto one line.
  3. Switch to Tree view to navigate large structures comfortably.
  4. Use Validate to surface syntax errors with line and column hints.
  5. Export the result, or convert between JSON, CSV, YAML, and XML.

Frequently asked questions

Does this validator support JSON5 or comments?

Strict JSON only by default. Trailing commas, comments, and unquoted keys will be flagged as errors. A JSON5 mode is on the roadmap.

How large a document can I format?

Tens of megabytes of JSON parse and format comfortably on a modern device. The tree view virtualises so navigation stays smooth even for large arrays.

Is my JSON sent anywhere?

No. The formatter is 100% browser-side; nothing you paste is ever uploaded. Safe for tokens, payloads, and proprietary data.

Why does the tool reject my JSON for using single quotes?

The JSON spec requires double quotes around all keys and string values. Single quotes are valid JavaScript but not valid JSON.

The five errors behind almost every invalid JSON

JSON's grammar is tiny, so failures cluster. Trailing commas after the last item are legal in JavaScript but fatal in JSON. Single quotes are not strings in JSON; only double quotes are. Unquoted keys ({name: "x"}) are object-literal syntax, not JSON. Comments do not exist in the standard at all, however much config files wish they did. And invisible characters... a BOM at file start, smart quotes pasted from a document, a non-breaking space... produce errors that look impossible because the offending character cannot be seen. A formatter surfaces all five instantly with a line and column number.

JSON is not a JavaScript object

The two look identical and are not. JSON has exactly six types: string, number, boolean, null, object, array. No undefined, no dates (everyone ships ISO 8601 strings and parses them by convention), no functions, no Infinity or NaN. Numbers are another quiet trap: JSON permits arbitrary precision but JavaScript parses into 64-bit floats, so an ID like 9007199254740993 silently corrupts. APIs that care transmit large IDs as strings.

Pretty vs minified is a context decision

  • Format with 2-space indentation for anything a human reads: configs, fixtures, API exploration, code review diffs.
  • Minify for transport and storage; whitespace can be 20-30% of a deeply nested payload.
  • Sort keys alphabetically when diffing two payloads, so the diff shows real changes rather than ordering noise.
  • Validate before you debug: ten minutes of staring at application logs has often ended at one missing comma a validator would have flagged in a second.

Advertisement