jfmt.dev

JSON Compare

Paste a left-hand document and a right-hand document to compare JSON as trees. The report groups additions, removals, and value changes by path — not by line — so reformatting the file does not fake a diff.

input.json

JSON formatter

Input0 B
Output · preview.json
{ }

Run a tool to see a polished result here

Live syncReady · processed locally in your browser
Local-only processing: your JSON never leaves this browser tab.

JSON compare vs a text diff

A line-based diff lights up whenever keys move or pretty-print width changes. JSON compare parses both sides, walks objects by key, and only reports structural drift: a new field, a deleted field, or a value that actually changed. Array positions still matter; object key order does not.

What counts as a change

Equal numbers, booleans, strings, and nulls are ignored. Reordering object keys is ignored. Pretty-print whitespace is ignored. Moving from 1 to "1" is a change because JSON types differ. Inserting a key that the left side never had is an addition. Dropping a key is a removal. Arrays are compared by index: swapping two items looks like two value changes, not a move.

{ "id": 1 } vs { "id": "1" } → changed $.id
{ "b": 1, "a": 2 } vs { "a": 2, "b": 1 } → equal
{ "tags": ["a", "b"] } vs { "tags": ["b", "a"] } → two array-index changes

Compare API payloads without uploading them

Ops and backend reviews often paste a production body next to a staging body. Because both documents stay in this tab, tokens inside the payload are not posted to jfmt.dev. Compare the decoded JSON, not the HTTP envelope, if headers or transfer encoding would otherwise create noise.

When JSON Diff is the better URL

JSON Diff on this site prints a compact unix-style list (+ / - / ~) that pastes cleanly into a ticket. JSON compare wraps the same engine in a grouped report aimed at people searching for “json compare”. If you already know you want a line-oriented path list, use Diff; if you want a readable before/after summary, stay here.

Sample input on this page

The left editor starts with a paid order. The compare field starts with the same order after a refund plus a second line item. Run the tool to see status change, a new customer.email, and items[1] appear as grouped differences.

{
  "orderId": "A-1001",
  "status": "paid",
  "customer": { "name": "Ada", "plan": "pro" },
  "items": [
    { "sku": "fmt", "qty": 1, "price": 9 }
  ]
}

How to use this tool

  1. Paste the original JSON on the left. Typical inputs are an API response, a saved fixture, or yesterday’s config export.
  2. Put the candidate JSON in “Compare with JSON”. That field is the right-hand document, not a filter expression.
  3. Run JSON compare. Added paths, removed paths, and changed values are grouped so you can scan contract drift instead of reading a unified text diff.
  4. If you want the compact + / - / ~ list used in reviews, open JSON Diff on this site. Both tools share the same local tree engine; only the report layout changes.

When this page is the right choice

Use JSON compare when the search intent is “compare two JSON files” — staging vs production configs, two versions of an order payload, or a snapshot test that failed. It is the wrong page if you only need to pretty-print one document or convert it to Excel.

FAQ

Does JSON compare treat key order as a difference?

No. Objects are compared by key name. `{"a":1,"b":2}` and `{"b":2,"a":1}` are equal.

Are arrays compared as sets?

No. Arrays keep index identity. `["a","b"]` vs `["b","a"]` reports two changed indexes, not a reorder.

How is this different from JSON Diff on jfmt.dev?

Both walk the same tree. Diff emits a flat + / - / ~ list. Compare groups those lines into Added / Removed / Changed and uses copy aimed at “json compare” searches.

Does 1 equal "1"?

No. A number and a string are different JSON types, so the path is reported as changed.

Is either JSON file uploaded?

No. Parsing and comparison run in a Web Worker in this tab.