To compare JSON, paste the original into Left JSON and the new version into Right JSON (or upload two .json files), then select Compare JSON. The tool parses both and walks every key and array item. Each difference is listed with its path, such as users[0].role, a label (added, removed, changed or type changed) and the old and new values.
How to compare two JSON files
- Add both versions. Paste the old JSON on the left and the new JSON on the right, or use Select Left File and Select Right File. A loaded file is compared right away.
- Pick the rules. Keep Array Compare on Strict order when position matters, or choose Ignore order for lists like tags. Tick Treat numeric strings as numbers if
"3000"and3000should match. - Compare. Select Compare JSON. The counters show total, added, removed, changed and type-changed values, and the Visual Diff Tree lists each one.
- Share the result. Use Copy Summary, Copy Diff Report or Download Report, which saves
json-diff-report.txt.
How this JSON diff works
A text diff compares lines, so moving a key or re-indenting a file shows up as a change. A JSON diff compares data. This tool parses both sides with JSON.parse, then walks them together: objects are matched key by key, arrays index by index, and plain values are compared directly. Two objects with the same keys in a different order are equal.
Take these two documents:
Left: {"name": "app", "version": 1, "tags": ["a", "b"], "port": "3000"}
Right: {"name": "app", "version": 2, "tags": ["b", "a"], "port": 3000, "beta": true}With the default settings the result is five differences:
| Path | Type | Old | New |
|---|---|---|---|
version | Changed | 1 | 2 |
tags[0] | Changed | "a" | "b" |
tags[1] | Changed | "b" | "a" |
port | Type changed | string | number |
beta | Added | missing | true |
In the Visual Diff Tree, green rows are added, red are removed, purple are changed and amber are type changes. When a whole object is added or removed, it's reported once at its own path rather than once per nested field.
Options that cut noise from a JSON compare
Run the same example with Ignore order and Treat numeric strings as numbers turned on, and only two differences remain: version changed and beta added. Each option handles a common source of false alarms:
- Array Compare: Ignore order. Both arrays are sorted by their content before comparing, so
["a","b"]equals["b","a"]. Leave it on Strict order for lists where position means something, like steps or ranked results. With Ignore order on, the index in a path refers to the sorted position. - Trim string values before compare.
"Ali "and"Ali"count as equal. - Treat numeric strings as numbers. Useful when one API returns
"3000"and another returns3000. - Path Filter. Type part of a path, such as
settingsorusers[0], to show only differences whose path contains it. Matching ignores case.
JSON compare vs text diff: which one to use
Use this JSON compare when you care about the data: checking an API response after a deploy, comparing feature-flag files across environments, or reviewing a changed fixture. Use a line-based diff checker when layout matters too, such as reviewing a hand-edited config before committing it, or when the input isn't valid JSON yet.
If either side fails to parse, the comparison stops and the badge under that editor shows the parser's error message. Fix it there, or clean it up in the JSON formatter first, which points to the exact line and column. Beautify Both re-indents both editors (and sorts keys when Preview Keys is set to sort) so you can read them side by side.
Limits of comparing JSON in the browser
Both files are parsed in your browser, so nothing is uploaded. That also means JavaScript's number rules apply: integers above 9,007,199,254,740,991 are rounded before comparing, so two long IDs that differ only in the last digits can look equal. Keep IDs like that as strings. If a key appears twice in one object, only its last value is compared.
In Strict order mode, inserting one item at the start of an array shifts every later index, so each one is reported as changed. Switch to Ignore order for that kind of list.
Frequently asked questions
How do I compare two JSON files online?
Upload the original with Select Left File and the new version with Select Right File. The comparison runs as soon as a file loads and lists every difference by path.
Does key order matter when comparing JSON?
No. Objects are matched key by key, so {"a":1,"b":2} and {"b":2,"a":1} are equal. Array order does matter unless you set Array Compare to Ignore order.
What does "type changed" mean in a JSON diff?
The value exists on both sides but its JSON type differs, for example the string "3000" on the left and the number 3000 on the right.
Can I ignore whitespace inside string values?
Yes. Tick Trim string values before compare, and leading or trailing spaces in strings are ignored.
Can I save the JSON diff result?
Yes. Download Report saves a .txt file with the summary and every change, including old and new values. Copy Diff Report puts the same detail on your clipboard.
Is it safe to use a JSON compare online tool with private data?
With this one, yes. Both documents are parsed and compared in your browser, so private API responses never leave your device.