Skip to main content
WizTools123
Free Online Tools

Tool Categories


JSON Tools New Tool

Free Online JSON Diff, Compare Two Documents By Structure

Compare two JSON documents in your browser and get a list of what actually changed, by path. Because the comparison walks both trees rather than the text, reordered keys and different indenting are not reported as differences. Values whose type changed are listed separately, since that is the change that breaks code quietly.

Free Forever Nothing Uploaded Structural, not text Reported by path
Free Online JSON Diff, Compare Two Documents By Structure
Share this tool
JSON Diff and Compare Your file is read inside this tab. Nothing is uploaded anywhere.
Drop the first JSON file here Or paste it below. The second document goes in the box after that. Choose a file Up to 15 MB per file. Nothing is uploaded.
0%
Or paste it
The second document
Reading
Comparing
Ignore these paths Useful for timestamps and request ids that change on every call.
The report

0 added 0 removed 0 changed 0 changed type

The differences
0 characters 0 lines 0 B
Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee

How to Use JSON Diff and Compare

Step by step, start to finish.

1
Put the first document in

Paste it or drop a file. The sample pair is already loaded, with a few differences of each kind to look at.

2
Paste the second one below

Two boxes rather than two files, because comparing two API responses usually means two things on the clipboard.

3
Decide about array order

Leave it on position for a list where order matters, such as steps. Switch it off for a set of tags or ids, where order means nothing.

4
Read the table, or take a patch

The readable list is for a person. The JSON Patch output is for applying the change somewhere else.

Key Features

What this tool does, and what it does not do.

Structural comparison

Both trees are walked, so key order and formatting never appear as differences.

Type changes separated

A number becoming text is called out on its own, because it is the change that quietly breaks code.

Arrays as sets

Ignore position for the arrays that are really bags of tags or ids.

Ignore noisy paths

Exclude timestamps and request ids so a live comparison reports only real changes.

JSON Patch output

An RFC 6902 patch of add, remove and replace operations, ready to apply elsewhere.

Nothing is uploaded

Both documents are parsed in this tab, so production responses stay put.

About JSON Diff and Compare

Comparing two JSON documents with a text diff is one of those habits that feels productive and wastes an afternoon. The tool is right there, it runs instantly, and it reports fifty differences in two files that are identical apart from the order their keys happen to be written in. JSON objects have no defined order, so a server is free to emit the same data in a different sequence on every call, and a line based diff treats that exactly like a real change.

Walking the parsed trees instead gives a short answer: these keys were added, these were removed, these values changed, and here is the path to each. The report is about the data, which is what you were asking about. It is also stable: run it twice on the same pair and you get the same list, however differently the two files are indented.

The one thing worth separating out is a change of type. When a field that held the number 1007 starts holding the string "1007", nothing looks broken. The document is valid, the value reads the same to a human, and most schema checks let it through. The code comparing it to a number stops working and the bug surfaces somewhere else entirely, which is why those changes get their own list rather than being mixed in with ordinary edits.

What can I adjust?

  • Ignore the order of items in arrays, for arrays that are really sets of tags or ids rather than sequences.
  • Treat tiny number differences as equal, so floating point rounding noise is not reported as a change.
  • List type changes separately, the switch behind the separate list described above.
  • Ignore these paths, such as a timestamp or a request id, which differ on every call to a live API.

What does the report look like?

Choose a readable list, a JSON summary, or a JSON Patch following RFC 6902, and tick Include what stayed the same when you want the unchanged paths listed as well. Counters above the report show how many paths were added, removed, changed and changed type. The patch is deliberately literal, a plain series of add, remove and replace operations, so it is easy to read through and check before you apply it to anything.

If one of the documents will not parse, the JSON Validator points at the exact line and column of the fault, so you can fix it and compare again.

Frequently Asked Questions

Common questions about this tool.

Because it compares lines. Reordered keys, different indenting and reformatting all change the text while leaving the data identical. This page compares the parsed documents, so only real changes appear.

It depends on what the array is. A list of steps or ranked results is a sequence, so position matters. A set of tags or ids is a bag, where moving an item means nothing. Leave it on position unless you know the array is a set.

Because they are the ones that break things quietly. A number that became text reads identically in a report and passes most validation, then trips up the code comparing it to a number. Keeping them apart puts them right in front of you.

Put the timestamp path in the ignore box, such as $.meta.requestId or $.updatedAt. It is left out of both the list and the counts, so the comparison tells you about the data rather than about the clock.

Applying the change somewhere else. It is a standard list of add, remove and replace operations on paths, which many APIs and libraries accept directly.

Instant on normal sized data. Comparing an array as a set means checking each item against the remaining ones, so a thousand item array is about a million comparisons and very large lists take noticeably longer. That is why it is off by default and switched on only for the arrays that need it.

More JSON Tools

Other tools from the same hub, free and in your browser.

All JSON Tools

Feedback

No feedback on this tool yet. Yours would be the first.