JSON Formatter

A full JSON editor in your browser — view as a tree, format, sort, query and validate, or switch to Compare to diff two documents. Everything stays on your device.

An editor, not just a formatter

Minified JSON from an API is one long line — fine for machines, painful for humans. The editor renders it as a tree you can expand, collapse and search, or you can drop into text mode for direct editing. Use the menu to format, compact or sort keys, repair broken JSON, or run a query to filter and reshape the data. Validation runs as you type, so mistakes surface immediately.

How to use it

  1. Paste or type your JSON into the editor. It's parsed and validated live, with errors flagged where they occur.
  2. Shape it. Format or compact from the menu, sort keys for a stable order, expand or collapse the tree, or run a transform to pick out exactly the fields you need.
  3. Compare two versions. Switch to the Compare tab, paste an original and a modified document, and see a structural diff with additions and removals highlighted.

Semantic vs. text diff

A plain text diff compares JSON line by line, so reformatting or reordering keys looks like a huge change even when the data is the same. The Compare tab does a structural diff: it understands objects, arrays and values, matches array items by their key where possible, and reports only what actually changed — added, removed or modified.

Frequently asked questions

What can the JSON editor do?

It shows your JSON as a collapsible tree or as plain text. You can format (prettify) or compact it, sort keys, search, repair broken JSON, and run a query or transform to filter and reshape the data — all with live validation that flags errors as you type.

How does the Compare tab work?

Paste one JSON document on the left and another on the right, then hit Compare. It runs a structural (semantic) diff, so it understands added, removed and changed values rather than just comparing text. Changes are highlighted in red and green.

How do I find a syntax error?

Type or paste into the editor and invalid JSON is flagged inline with the location of the problem. The usual culprits are a trailing comma, a missing or smart quote, or an unclosed bracket. The editor can also repair many common mistakes for you.

Is my JSON sent anywhere?

No. Editing, formatting, validation and diffing all run in your browser with JavaScript. Nothing you paste is uploaded, logged or stored.

Does it support comments or trailing commas?

Strict JSON doesn't allow comments or trailing commas, but the editor's repair feature can clean up many of these (sometimes called JSON5 or JSONC) so you end up with valid JSON.