Skip to tool
All tools

JSON diff

Added, removed and changed values with their paths.

Questions

What does this tool do?

The JSON diff compares two documents as trees, not as text: what B adds, what it drops and what it changes, each with its path — a.b[2].c — and the value before and after. It fits two API responses, two config files, or a fixture before and after a migration; id fields, timestamps and the order of arrays can be ignored when they are noise.

How is this different from a text diff?

A text diff sees lines; this sees keys and values. Reordered keys, different indentation and whitespace a formatter changed are not differences here. A key present in one document only, or a value that differs, is.

What do Added, Removed and Changed mean?

Added: in B, not in A. Removed: in A, not in B. Changed: in both with different values — including a value that changed type, an object where there was a string, or null where there was a number.

How are arrays compared?

By position: the third item of A against the third of B. Switch on order of arrays to compare by content instead — then an item counts as added or removed only when no equal item exists on the other side, wherever it sits.

What do the Ignore chips drop?

id fields drops keys named id and keys ending in _id or Id. timestamps drops keys ending in _at, At or _ts and keys named timestamp or timestamps. Both are off by default: the diff shows everything unless you say otherwise.

How do I read a path?

Keys joined by dots, array positions in square brackets counted from 0: user.addresses[2].city is the city of the third address. A key that is not a plain name is quoted in brackets, as in headers["content-type"].

Related tools