JSON Diff Checker
Compare two JSON documents and list every added, removed and changed value by its path, ignoring key order and formatting.
Was this tool helpful?
Thanks for the feedback!
This tool compares two JSON documents and lists every value that was added, removed or changed, each with its exact path. It reads the data rather than the text, so different key order, spacing and line breaks do not show up as differences. It is useful for developers and testers comparing API responses, config files or translation files, and the comparison runs in your browser, so nothing is uploaded.
How to use it and how to read the result
Paste the older version into Original JSON and the newer one into Changed JSON, then press Compare JSON. Each line of the result starts with a symbol:
+a key or array item that exists only in the changed JSON-a key or array item that exists only in the original~a value that is in both but different, shown as old → new
Counters for Added, Removed and Changed appear above the result. Paths start at $, which stands for the whole document. Simple key names are joined with a dot, such as $.address.city. Keys with hyphens, spaces or a leading digit are written in brackets, such as $["order-id"], and array positions look like $.skills[2]. Very long values are cut to 120 characters with an ellipsis so the list stays readable.
How the comparison works
The tool walks both documents together. When both sides are objects, it takes every key found in either one, sorts them alphabetically and compares key by key, so the result does not depend on the order keys were written in. When both sides are arrays, it compares item 0 with item 0, item 1 with item 1 and so on. For anything else it compares the exact JSON value, which means a number and a string are different even if they look alike.
Worked example
Original:
{"id":101,"name":"Asha","city":"Pune","skills":["SQL","Python"],"active":true}
Changed:
{"id":101,"name":"Asha","city":"Bengaluru","skills":["SQL","Python","Go"],"salary":1250000}
Result, with Added 2, Removed 1, Changed 1:
- $.active: true
~ $.city: "Pune" → "Bengaluru"
+ $.salary: 1250000
+ $.skills[2]: "Go"
The unchanged id and name are not listed. If the two documents hold the same data, you see "No differences: both documents hold the same data (key order is ignored)."
Edge cases worth knowing
- Arrays are compared by position. Removing the first item of
[1,2,3]to get[2,3]shows~ $[0]: 1 → 2,~ $[1]: 2 → 3and- $[2]: 3. If order does not matter in your list, sort both arrays the same way before comparing. - Type changes count as changes:
{"a":1}against{"a":"1"}gives~ $.a: 1 → "1". This catches APIs that start sending numbers as strings. - If a whole object is replaced, for example
{"a":{"b":1}}becoming{"a":5}, you get one line,~ $.a: {"b":1} → 5, instead of a list of removed keys. - Invalid JSON is reported per box. A missing quote in the second box gives a message starting "The changed JSON is not valid:" followed by the browser's description of where parsing failed.
Where it helps, and related tools
A few everyday jobs where a path-by-path list beats reading two files side by side:
- Checking what an API returns before and after a release, so you can see a renamed or dropped field before a mobile app breaks on it.
- Comparing the settings file on a staging server with the one on production.
- Finding keys missing from a translation file. Values in en.json and hi.json will all differ, but the
+and-lines show exactly which keys exist in only one file. - Reviewing a change to a large fixture or mock file in a pull request.
To check or tidy a document before comparing, use the JSON validator. To see a full side-by-side view with keys in the same order, run both files through the JSON key sorter first.
Frequently asked questions
How do I compare two JSON files online?
Does key order matter when comparing JSON?
Why does removing one array item show several changes?
Is the number 1 the same as the string "1" in a JSON diff?
What does the $ mean in the diff paths?
Can I compare minified JSON with formatted JSON?
Related guides
- Free Developer Tools That Replace a Dozen Browser Tabs Free developer tools grouped by job: format, convert, encode, generate and test. What each one does, which run on the server, and the limits to know f...
- How to Beautify CSS, HTML and XML (Online, VS Code, Prettier) Beautifying adds line breaks and indentation so minified CSS, HTML or XML is readable again. How the free formatters work, their limits, and VS Code a...
- How to Format JSON: Pretty-Print, Validate and Read Errors Paste JSON into a formatter to indent it and catch errors. The exact syntax rules, how to read an error position, and how to do it in VS Code, Python...