JSON Diff
Compare two JSON values semantically. Ignores key order; shows added, removed, and changed fields with their JSONPath — great for diffing API responses and config files.
- $.tags[2] "beta"
- $.address.city "NYC" → "Brooklyn"
- $.deprecated_field "remove me"
- $.new_field "added"
{"address": {~ "city": "NYC","zip": "10001"},- "deprecated_field": "remove me","id": 42,"name": "Alice","tags": ["admin","user"]}
{"address": {~ "city": "Brooklyn","zip": "10001"},"id": 42,"name": "Alice",+ "new_field": "added","tags": ["admin","user",+ "beta"]}
How to use the json diff
Paste two JSON values side-by-side. The diff compares them semantically — by value, not by text — so key reordering is ignored. Added keys appear in green, removed in red, changed in amber, each with the JSONPath where the difference lives.
Formula & explanation
Semantic diff walks both values in parallel: objects are compared by union of keys, arrays element-by-element, primitives by equality. Output is a flat list of (path, change) pairs rather than a text diff.
Examples
Two responses with the same fields in a different order produce no diff. Adding a tag to an array shows as `+ $.tags[2]`. Changing a nested value shows as `~ $.address.city "NYC" -> "Brooklyn"`.
Frequently asked questions
- Why not just use a text diff?
- Text diff treats key order as significant — `{"a":1,"b":2}` and `{"b":2,"a":1}` look different even though they're semantically identical. APIs often return keys in different orders across calls (especially across language bindings), so text diff produces noise for working JSON.
- How does array diffing work?
- Element-by-element, by index. So `[1,2,3]` vs `[1,2,3,4]` shows as `+ $[3] 4`. `[1,2,3]` vs `[3,2,1]` shows three changes (every position differs). Set-style diffing where order doesn't matter is a different operation — for that, sort both arrays before pasting, or use the List Set Operations tool.
- Can I diff two large JSON files?
- The diff is in-browser and handles a few MB comfortably. Beyond that, browser JSON.parse + diff gets slow (seconds, not minutes). For multi-megabyte files, use a command-line tool like `jd` or `dyff`.
- Does it handle JSON5 / comments / trailing commas?
- No — strict JSON only. If your input has comments or trailing commas, strip them first (or paste through the JSON Formatter, which will reject them with a clear error).
- What's JSONPath?
- The standard syntax for pointing into a JSON document. `$` is the root, `.key` is an object property, `[i]` is an array index. So `$.users[2].name` means "the name of the third user." The same paths work in tools like jq (with slightly different syntax) and JSONPath libraries.
Related developer tools tools
- JSON FormatterPretty-print, minify, and validate JSON. Detects syntax errors with line numbers and supports nested structures of any depth.
- XML to JSON ConverterConvert XML to JSON for legacy API integration, SOAP responses, and config migration. Handles attributes, namespaces, and text content.
- JSON to XML ConverterConvert JSON objects and arrays to well-formed XML. Maps object keys to elements, array items to repeated elements, with optional root wrapper.
- JSON to YAML ConverterConvert JSON to clean indented YAML for Kubernetes manifests, Docker Compose, CI configs, and Helm charts. Preserves nested structures.
- JSON to CSV ConverterConvert JSON arrays to CSV with automatic header detection from object keys. Handles nested values and arbitrary delimiters.
- JSON to TypeScriptGenerate TypeScript interfaces and types from any sample JSON. Handles nested objects, arrays, optional fields, and mixed types. Paste JSON, copy the interface.