JSON Diff

How to use 3 steps
  1. Paste the Original JSON and the Changed JSON.
  2. Tick Treat arrays as unordered sets if order doesn't matter.
  3. Press Compare and review what was added, removed or changed.
Differences

This compares the parsed structures, not the text, so reformatting, key order and whitespace never register as changes — only real differences in values do. Arrays are compared by position by default, which is right for ordered data; the unordered option instead reports which entries were added and removed regardless of where they sit.

How this tool works

The two documents are compared structurally rather than as text, walking both trees together and reporting each difference by its path. That is what makes the result useful: reformatting a file, reordering its keys or changing its indentation produces no differences at all, where a text comparison would report the whole file as changed.

Three settings change what counts as a difference. Ignoring array order compares arrays as sets, which is right for a list of tags and wrong for an ordered sequence. Loose type comparison treats the string 1 and the number 1 as equal, which is useful when one side has been through a system that stringifies everything. Showing unchanged values makes the output complete rather than only reporting deltas.

Reading the comparison

  • Paths tell you where, not why: each difference is reported by its location in the tree, which is what you need to find it in the source. Two documents may differ in one field at fifty paths if that field repeats.
  • Array order matters unless you say otherwise: by default an element that moved is a difference. That is correct for an ordered list and noise for an unordered one.
  • Type changes are reported as changes: a field that was a number and is now a string differs even when it looks the same printed, and that is exactly the kind of fault worth catching.
  • It compares data, not formatting: whitespace, key order and indentation are invisible to it. Use a text comparison if formatting is what you are checking.

Structure is compared, not text

The [msm_tool slug="json-diff"] walks both documents as trees rather than comparing them line by line as text, which means reformatting a file, reordering its keys, or changing its indentation produces no reported differences at all — a text-based comparison would flag the entire file as changed for exactly the same edit. Every genuine difference is reported by the path where it occurs in the tree.

Array order matters, until told otherwise

By default, an element that moved position within an array counts as a difference, which is correct wherever the order itself carries meaning — a sequence of steps, a list of instructions. Turning that setting off compares arrays as sets instead, which is the right mode for a list of tags, permissions or identifiers where membership matters and order does not.

What loose type comparison actually changes

With loose comparison enabled, the string `"1"` and the number `1` are treated as equal, which is useful specifically when one side of the comparison has passed through a system that turns every value into a string on the way. Left at the default strict comparison, the same pair is reported as a genuine difference.

A type change is reported even when the printed value looks identical

A field that used to hold a number and now holds a string differs structurally even if both happen to print the same digits, and that distinction is reported rather than smoothed over — it is frequently the exact kind of fault worth catching before it reaches something downstream that expected a number and receives text instead.

Why the same field can show up at many paths

Each occurrence of a value in the tree gets its own path in the report, so a field that repeats at many points in the structure produces one reported difference per occurrence rather than a single summary. That is what makes it possible to find every instance rather than fixing one and assuming the rest followed.

What it deliberately will not do

Whitespace, key order and indentation are invisible to this comparison by design, since none of them change what the data actually says. A text-based diff tool is the right choice when formatting itself is the thing being checked, rather than the values underneath it.

Frequently Asked Questions

Specific to the JSON Diff. Broader questions about this category are answered on the category page.

Because it compares structure. Different formatting, indentation or key order with the same data means no difference, which is usually what you want.
When the array is a set — tags, permissions, identifiers. Never when order carries meaning, such as a sequence of steps.
It treats the string 1 and the number 1 as equal. Useful when one side has passed through a system that turns everything into strings.
Because it occurs at many places in the tree. Each occurrence is its own path so you can find them all.
No, and deliberately so. Whitespace and key order are invisible to it. A text comparison tool is the right choice for that.

Subscribe to receive notifications about new tools, features, and productivity tips.