Skip to main content

JSON Compare

Compare two JSON documents and see line-by-line differences highlighted. Find changed values, added keys and removed fields in API responses quickly.

Original JSON

Stays in your browser

Changed JSON

Stays in your browser

Compares the data, not the text: key order is ignored and lists are compared position by position, or by a key such as id.

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to JSON Editor or JSON Visualizer.

Online JSON Compare & Diff Tool

Comparing two JSON payloads by eye is slow and easy to get wrong. Paste an API response before and after a change, two config file versions, or two test fixtures, and this tool highlights exactly which lines were added, removed, or changed — useful for debugging why a response shape shifted or reviewing a config diff before deploying it. For code use the Code Diff Checker; for plain text and documents use Text Compare. It helps QA teams and API developers spot changed, added, or removed values between two JSON documents.

How to compare two JSON files online

Paste the original JSON into the left box and the changed version into the right box, then click Compare. Both sides are validated and pretty-printed first, so differences in spacing or indentation alone won't create false positives — you only see differences that reflect an actual change in the data.

Reading the diff result

Each changed line is marked with a + (added in the new version) or - (removed from the original), and a running count of additions and removals is shown above the diff. Unchanged lines are included for context, so you can see exactly where in the structure a change happened rather than just that something changed somewhere.

A note on key order

JSON objects have no inherent key order, so two objects with the same keys and values in a different order are the same data. Structural diff (the default) ignores key order but still treats the order of list items as meaningful, comparing them position by position, or by a key such as id if you fill in "Match list items by key". Text diff compares line by line, so a reordered key still shows up there.

Common use cases

  • Reviewing exactly what changed in an API response before and after a backend deploy
  • Comparing two versions of a configuration file before merging a change
  • Diffing test fixtures to understand why a snapshot test started failing
  • Spotting an unexpected field addition or removal in a webhook payload

Worked example

{"name":"Ada","age":30} against {"name":"Ada","age":31} shows only the "age" line as changed after both are pretty-printed to matching indentation. But {"name":"Ada","age":30} against the key-reordered {"age":30,"name":"Ada"} — identical data, different key order — shows no differences in Structural diff, but both lines as changed in Text diff. The first pair in Structural diff is listed as $.age: 30 → 31.

Common mistakes and edge cases

  • This tool shares the same line-diff engine as Diff Checker and Text Compare — checked against the source. The JSON-specific difference is that both sides are beautified to consistent indentation first, so only real data differences (not formatting) show up.
  • In Text diff mode key order still counts as a difference. Switch to Structural diff to ignore it.
  • In Structural diff, list items are compared by position unless you give a key. If items were inserted at the start, every later item looks changed; fill in "Match list items by key" (for example id) to avoid that. Matching by key only applies when every item in both lists is an object with a different, plain-text or number value for that key.
  • The exported JSON Patch always works by position, so it can be longer than the list shown when you match by key.

Frequently asked questions

Why does my JSON compare show differences even though the data looks the same?
Use "Structural diff" (the default): it compares the data itself, so spacing and the order of keys in an object never count as a difference. In "Text diff" mode both sides are only pretty-printed and compared line by line, so the same keys in a different order will still show as a diff even though the data is identical.
Is my JSON data uploaded anywhere when I compare it?
No. The diff is computed entirely in your browser using a local line-diff algorithm — neither side of the comparison is ever sent to a server.
What do the + and - markers mean in the diff result?
A green line marked "+" was added in the changed JSON; a red line marked "-" was removed compared to the original. Unmarked lines are unchanged and shown for context.
Can I compare very large JSON documents?
Yes, though the line-diff algorithm is capped at 5,000 lines per side to keep the comparison fast and avoid freezing the tab on extremely large payloads.
Is this a different diff engine than the Diff Checker or Text Compare tools?
No — as tested, all three tools import the exact same line-diff function. The only difference here is that both sides are run through the JSON beautifier first, normalizing indentation to a consistent 2 spaces before comparing, which is specifically why whitespace formatting alone doesn't create false-positive differences the way it can on the other two tools.
How do I compare two JSON objects?
Put the older document on the left and the newer one on the right. The result lists what was added, removed and changed by path, so a moved key is not shown as a whole new block the way a plain text diff would. Differences in key order and in spacing are ignored, because they do not change the data.

Related tools

More Formatters & Parsers

View all Formatters & Parsers tools →