$ SudoStuff

JSON Diff

Compare two JSON documents structurally.

Processed locally in your browser. Nothing you type here is sent to our servers.

What is the JSON diff?

A plain text diff of two JSON documents reports far too much. Reorder the keys, reindent one file, and every line looks changed even though the data is identical. This tool compares the two documents as data: it parses both, walks the trees together, and reports only the values that genuinely differ.

Every difference is reported with its full path — $.features.favorites, $.tags[2] — so you can find it in the source immediately.

How to use it

  1. Paste the original document on the left and the changed one on the right.
  2. Press Compare, or ⌘/Ctrl + Enter.
  3. Read the summary counts, then the table of individual differences.
  4. Tick Show unchanged values to see the full document alongside the changes.

Each row is marked + for added, − for removed and ~ for changed, with a matching text label for screen readers, so the meaning never depends on the colour alone.

How the comparison works

  • Objects are compared by key. Key order is irrelevant, so {"a":1,"b":2} and {"b":2,"a":1} are identical.
  • Arrays are compared by position. Index 0 is compared with index 0, and so on.
  • Type changes are reported as one change rather than as a removal plus an addition.
  • A missing key and a key set to null are treated as different, because to most APIs they mean different things.

Common use cases

  • Working out what changed between two API responses when a request starts failing.
  • Comparing configuration between two environments.
  • Reviewing a change to a large fixture without reading the whole file.
  • Confirming that a refactor left a serialised payload byte-for-byte equivalent in meaning.

Limitations

  • Arrays are compared positionally. Inserting one item at the start of a long array therefore reports every subsequent element as changed, because index 1 is genuinely compared against index 1. There is no reliable way to guess identity inside an arbitrary array.
  • Very large documents produce very large tables. The comparison is fast, but rendering thousands of rows is not.
  • Numbers are compared after JSON parsing, so 1.0 and 1 are equal — they are the same value once parsed.
↑↓ navigate ↵ open esc close