JSON diff
Compare two JSON objects and get the differences between them.
About JSON diff
Compares two JSON documents and shows what was added, removed or changed, as a tree with colour coding. Both inputs accept relaxed JSON5, so comments and trailing commas do not get in the way.
When you would use it
- Comparing an API response before and after a deploy to see exactly which fields changed.
- Reviewing two versions of a configuration file without relying on line-by-line text diffs.
- Checking that a serializer or migration produced the same data as the original.
How to use it
- Paste the original JSON into the first field.
- Paste the JSON to compare into the second field.
- Read the tree below: added, removed and changed entries are highlighted, and unchanged ones are shown for context.
Things worth knowing
- Objects are compared key by key, so the order of keys does not matter and reordering alone is not reported as a change.
- Arrays are compared by position. Inserting an item at the start shifts everything after it, so many entries may show as changed. Sort or key the arrays first when order is not meaningful.
- A value whose type changes (for example the number 1 to the string "1") is reported as a change.
- If either side is not valid JSON, the field shows an error and no comparison is made.
Frequently asked questions
- How is this different from a normal text diff?
- A text diff compares lines, so reformatting or reordering keys produces a lot of noise. This tool compares the parsed data, so only real differences in keys, values and types appear.
- Can it ignore certain fields such as timestamps?
- Not at the moment. Remove those fields from both inputs before comparing.