JSON Diff

Compare two JSON documents.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste an original and a changed JSON document and get one line per difference, written as a path with the old and new value. Key order does not matter. Arrays are compared position by position.

How to use

1
Step 1
Paste the original JSON on the left.
2
Step 2
Paste the changed JSON on the right.
3
Step 3
Press Run to list the differences.

How it works

Both documents are parsed and compared recursively. For objects the union of keys is checked, and a mismatch is reported as /path: old -> new. A key that exists only on the right shows the old value as undefined, and a key that exists only on the left shows the new value as undefined. Arrays are compared index by index.

Worked example

Changed, removed and added

Input
Left: {"name":"Ada","age":30,"tags":["a","b"]} Right: {"name":"Ada","age":31,"tags":["a"],"city":"Paris"}
Output
/age: 30 -> 31 /tags/1: "b" -> undefined /city: undefined -> "Paris"
Walkthrough
age changed, the second tag was removed, and city was added. name is unchanged, so it is not listed.

Limitations

  • Arrays are compared by index. Inserting an item at the start reports every following item as changed.
  • Invalid JSON gives the browser's parse error rather than a line and column.
  • Identical documents print No differences.

Questions

How do I compare two JSON files?
Paste one in each box and press Run. Every difference is listed with its path.
Does key order matter?
No. Objects are compared by key, so reordered keys are not reported.
What does undefined mean in the output?
That side has no value at the path: the key was added or removed.
Why does one inserted array item show many changes?
Arrays are compared position by position, so everything after the insertion point shifts.

Features

  • Path-based report
  • Key order ignored
  • Added and removed keys
  • Runs in your browser

Guides

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • How base64 encoding works

    Andrew Schmelyun

    Mental model for Base64 encode/decode tools.

    Watch on YouTube
  • SQL Tutorial - Full Database Course

    freeCodeCamp.org

    JSON often lands next to SQL exports when debugging data pipelines.

    Watch on YouTube
  • Introducing JSON

    json.org

    Canonical JSON grammar—handy when a formatter rejects a trailing comma.

  • MDN Web Docs

    MDN

    Primary reference for web APIs these developer tools touch.