Compare JSON Documents

Paste two API responses and see every changed path.

Results update as you type. Ctrl + Enter diffs now.

Options

Match objects by key pairs records by id or any field you enter, so a record that only moved is listed as moved, not edited. If a record has no key or a key appears twice, that array is flagged and compared by position.

Differences

    How to compare JSON

    Paste the original response into Left / Original and the new response into Right / Modified, or press Load example. Every structural difference is listed as a path with its old and new values. Use Swap to flip the sides, filter chips to focus on added, removed, changed or moved paths, and Copy summary or Download JSON to share the result. Everything runs in your browser, so nothing you paste is uploaded.

    Missing keys vs explicit nulls

    An absent key and a key set to null mean different things in most APIs, so the diff tells them apart: a value that is not there is shown as <missing>, while an explicit null is shown as null.

    LeftRightResult
    {"a": null} {} $.a removed: null → <missing>
    {} {"a": null} $.a added: <missing> → null
    {"a": null} {"a": 1} $.a changed: null → 1

    Examples

    LeftRightDiff
    {"a": 1} {"a": 2} $.a changed: 1 → 2
    {"a": null} {} $.a removed: null → <missing> (was explicit null)
    {"tags": ["cs"]} {"tags": ["cs", "math"]} $.tags[1] added: <missing> → "math"

    Limits and edge cases

    • Arrays compare positionally by default ($.tags[1]), so a reorder shows as changes at each affected index. Set Compare arrays to Match objects by key to match records by id or any field instead: shared keys diff by path, e.g. $.users[id=5].name.
    • In keyed mode a pure reorder lists as moved, separate from value changes; a record that both moved and changed shows both a move and its value changes. Records with a missing or duplicate key are never guessed. They go under Records that couldn't be matched, apart from the differences and not counted in them, each on its own side with its value and the reason. Each group then says which of three things is true: same values, meaning both sides hold identical records and nothing changed; same values, extra copies, meaning the records are identical but one side has more copies of some, so again no value changed; or values differ, meaning something changed but the tool can't tell which record. Records with a unique key in the same array are still paired normally.
    • Object key order is ignored: {"a":1,"b":2} and {"b":2,"a":1} have no differences.
    • Nesting depth is unlimited; paths use dot notation for keys and brackets for indices, e.g. $.meta.tags[2].
    • Numbers compare by value, so 1 and 1.0 are equal, while 1 and "1" are a type change.

    Frequently asked questions

    How do I compare two JSON documents?

    Paste the original JSON on the left and the modified JSON on the right. Every added, removed or changed path is listed instantly with its old and new values.

    What is the difference between a missing key and null?

    A missing key means the property is absent; null means it is present with an explicit null value. The diff shows absent values as <missing> and explicit nulls as null, so removed $.meta.score with old value null is different from a key that never existed.

    How are arrays compared?

    By default arrays compare index by index, so $.tags[1] added means the right side has an extra item at index 1 and a reorder shows as changes. Set Compare arrays to Match objects by key to match records by id or another field instead: shared keys diff by paths like $.users[id=5].name, pure reorders report as moved, and records with a missing or duplicate key are listed apart as not matched, never paired and never counted as differences, with a note saying whether their values are the same on both sides, the same with extra copies on one side, or different.

    Does key order matter?

    No. Object keys are compared without regard to order, so {a:1,b:2} and {b:2,a:1} show no differences.

    What happens if my JSON is invalid?

    The side with the syntax error is flagged with its parser message, prefixed Left or Right, and no diff entries are shown until both sides parse.

    Is my JSON uploaded anywhere?

    No. The comparison runs in your browser with JavaScript and nothing is sent to a server. The two editor boxes are kept in your browser's local storage so they are still there when you come back.