JSON Formatter / Validator / Viewer

Format, minify, validate, sort, and inspect JSON with a tree viewer, parse error details, structure metrics, copy, and download output.

Format JSON and see what changed

Use this JSON tool when a payload needs to move from unreadable blob to something you can debug. Paste JSON from an API response, config file, webhook body, browser storage export, or log line. The formatter validates the syntax, reports parse failures, and can output readable indentation, compact minified JSON, or an expandable tree view.

Sorting object keys is useful when comparing generated snapshots or checking if two objects differ only by order. The structure counters help you quickly spot whether you are dealing with a shallow settings object, a nested API envelope, or a large array-heavy response.

Loading tool...

Good uses

  • Format API and webhook payloads before pasting them into tickets, docs, or code reviews.
  • Minify JSON for environment variables, fixtures, or compact test inputs.
  • Sort object keys to make object comparisons easier in diffs and screenshots.
  • Use the tree view to inspect nested data without losing your place in a long string.
  • Check object, array, property, node, byte, and depth counts before deciding how to process the data.

Strict JSON rules

The validator uses strict JSON parsing. That means comments, trailing commas, single-quoted strings, unquoted object keys, Infinity, NaN, and other JavaScript object-literal shortcuts are not valid JSON. If a backend or tool accepts those extensions, normalize the value before treating it as portable JSON.

JSON formatter FAQ

Does this upload my JSON?

No. Formatting, minifying, sorting, validation, and tree rendering happen in the browser.

Will key sorting change arrays?

No. Sorting applies to object keys. Array order is preserved because array order usually carries meaning.

Why is my JavaScript object invalid?

JSON is stricter than JavaScript object syntax. Use double quotes for strings and keys, remove comments, and remove trailing commas.