Skip to content
Devtoolry

JSON Diff

Compare two JSON documents online, ignoring key order and formatting. Keys are normalised and sorted, so only real changes in values are highlighted.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the JSON Diff

A plain text diff of JSON flags every reordered key. The JSON Diff parses both documents and compares them semantically, so only real differences in values, added keys and removed keys are shown.

Both versions are compared in your browser, so private code and documents never leave your device.

How to use the JSON Diff

  1. Paste the two JSON documents.
  2. Fix any syntax error that is reported.
  3. Review the highlighted value changes, additions and removals.

Example

Find the real change between two responses

Input

Original: {"name":"Ada","plan":"free","tags":["a","b"]}
Changed:  {"tags":["a","b"],"plan":"pro","name":"Ada","seats":5}

Result

-  "plan": "free",
+  "plan": "pro",
+  "seats": 5,

The key order is different, but only the plan value and the new seats key are reported.

Common mistakes

  • Array order counts. Arrays are ordered, so ["a", "b"] and ["b", "a"] are different. Sort arrays in your code before comparing if their order does not matter.
  • Numbers and strings. 1 and "1" are different JSON values. A changed type is reported even when the text looks almost the same.
  • Invalid input. Both sides must be valid JSON before they can be compared. Fix the reported error first, or use the text diff for fragments.

Works well with the JSON Diff

Frequently asked questions

Does key order matter?

No. Keys are normalised and sorted before comparing, because JSON objects are unordered.

Does array order matter?

Yes. Arrays are ordered in JSON, so moving an item is reported as a change.

How do I compare two API responses?

Paste the old response on the left and the new one on the right. Keys are sorted on both sides first, so only added, removed and changed values are highlighted.

Can I export the differences?

Yes. Copy the differences or download them as a unified diff file (changes.diff) to attach to a bug report or code review.

How do I compare two JSON files online?

Choose Open file above each panel, or drop both .json files on either panel: the first fills Original and the second fills Changed. Both files are read in your browser and never uploaded.

Guides and tutorials