Skip to content

Menu

JSON Diff

Deep structural diff between two JSON documents with color-coded changes.

Runs entirely in your browserJSON ToolsFree, no sign-up
Loading tool

01What is JSON Diff?

Paste the original JSON on the left and the changed version on the right. JSON Diff walks both structures and lists every difference with its path. It is handy when two API responses look the same at a glance but a test still fails. Each entry is one of three kinds. Added means the key or array item exists only on the right, shown in green with a plus. Removed means it exists only on the left, shown in red with a minus. Changed means both sides have it with a different value, shown in yellow with the old and new values. A counter above the list totals each kind, and two identical documents get a plain no-differences message. The comparison rules are easy to predict. Object keys are matched by name, so reordering keys is never a change. RFC 8259 treats objects as unordered anyway. Keys are visited in alphabetical order, which keeps the output stable between runs. Arrays are compared by index. That keeps the logic simple, but inserting one item near the start makes every later item look changed. A type change, such as the number 1 becoming the string "1" or null becoming 0, is reported once at that path. The tool does not dig further into it. Paths follow the JSONPath style from RFC 9535 and start at $. Plain keys use dots, as in $.db.host. Array items use indexes, as in $.users[1].name. Keys with spaces, dashes or dots are quoted in brackets, as in $.headers['content-type']. That way a key with a dot in it can't be mistaken for nesting. Keys such as constructor or toString are treated as ordinary data, because the code checks own properties only. A worked example: the left side is {"a":1,"b":[1,2,3]} and the right side is {"a":"1","b":[1,3]}. You get three lines. $.a changed from 1 to "1". $.b[1] changed from 2 to 3. $.b[2] was removed. A person would say one item was deleted from the middle, but an index diff sees it differently. Copy Diff gives a plain-text list with +, - and ~ markers, ready for a ticket. Swap flips the two sides. Both documents are parsed and compared in the page itself, so your config files never leave the tab. The limits: output is a flat list rather than a tree, there is no move detection, and it does not produce RFC 6902 JSON Patch operations.

API developers comparing response versions, QA engineers reading failed assertions and DevOps engineers checking config changes before a deploy. The tool runs entirely in your browser, so your data never leaves your device.

02How to use JSON Diff

  1. Paste the original JSON document in the left panel.
  2. Paste the changed JSON document in the right panel.
  3. Read the added, removed and changed counts and the colour-coded list of paths.
  4. Click Swap if you pasted the documents the wrong way round.
  5. Click Copy Diff to get the whole list as plain text with +, - and ~ markers.

03Worked examples

Input: Left {"a":1,"b":[1,2,3]} Right {"a":"1","b":[1,3]}
Result: ~ $.a: 1 -> "1" ~ $.b[1]: 2 -> 3 - $.b[2]: 3
Arrays are compared by index, so removing a middle item shows as a change plus a removal at the end.
Input: Left {"user":{"first name":"Ada"}} Right {"user":{"first name":"Bea","age":36}}
Result: + $.user.age: 36 ~ $.user['first name']: "Ada" -> "Bea"
A key with a space is quoted in brackets. Keys are listed alphabetically.
Input: Left {"x":null} Right {}
Result: - $.x: null
A key set to null and a missing key are different.
Input: Left {"n":1} Right {"n":1.0}
Result: No differences
1 and 1.0 parse to the same number.
Input: Left {"headers":{"content-type":"text/html"},"constructor":1} Right {"headers":{"content-type":"application/json"},"constructor":2}
Result: ~ $.constructor: 1 -> 2 ~ $.headers['content-type']: "text/html" -> "application/json"
constructor is handled as normal data.
Input: Left [1,2] Right {"a":1}
Result: ~ $: [1,2] -> {"a":1}
A type change at the root is one entry. The tool does not look inside.

04Common use cases

  • Comparing a staging API response with production after a deploy to find the field that changed
  • Reviewing a changed config file before merging, when the git diff is noisy because keys were reordered
  • Checking a before and after export of a record to confirm a migration kept every field
  • Spotting a number that became a string after a payload passed through another service
  • Pasting the expected and actual JSON from a failing test to see exactly which path differs
  • Writing a short changelog of config changes for a ticket using Copy Diff

05Tips

  • Key order never counts as a change, so you can paste pretty-printed JSON against minified JSON without trouble.
  • Arrays are matched by index. If order doesn't matter, sort both arrays the same way before pasting or you'll see a wall of changes.
  • A key set to null and a missing key are reported as different, which often explains a schema validator complaint.
  • If one side fails to parse, the error shows under that panel. Trailing commas and single quotes are the usual reasons, since JSON allows neither.
  • 1 and 1.0 parse to the same number, so a diff won't flag them. Compare the raw text if formatting of numbers matters to you.

06Related concepts

RFC 6902 JSON Patch, RFC 9535 JSONPath, Deep equality, Structural diff, JSON Merge Patch.

Frequently Asked Questions

What is JSON Diff?

JSON Diff is a free, browser-based developer tool on AIDToolStack. Deep structural diff between two JSON documents with color-coded changes. It requires no installation or sign-up and works entirely in your browser.

Is JSON Diff free to use?

Yes. No sign-up, no fees and no usage cap.

Does JSON Diff store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe