JSON Diff
Compare two JSON documents.
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
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?
Does key order matter?
What does undefined mean in the output?
Why does one inserted array item show many changes?
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 YouTubeSQL 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.