Skip to content
Server-sideDeleted in 30 minutes

Compare Two JSON Documents

Compare two JSON documents without treating every reordered object key as a change. Both values are parsed, object key order is ignored, array order is preserved, and the report lists added, removed, or changed paths such as `$.user.name` and `$.items[2]`. It is useful for API response checks and configuration reviews, and the output is capped at 500 paths so a huge payload cannot produce an unusable wall of text.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free
Left JSON
Right JSON
0
Differences
Diff
PathChange

What it does

  • Nothing you paste is stored, even briefly
  • Ignore object key order
  • Preserve array order and indexes
  • Show added, removed, and changed paths
  • Copy or download the textual diff

How to use JSON Diff

  1. 1

    Paste the original

    Put the first API response or JSON document in the Original panel. Valid JSON is required; comments and trailing commas are not accepted.

  2. 2

    Paste the updated value

    Put the second document in Updated JSON. The comparison treats object key order as irrelevant but keeps array order meaningful.

  3. 3

    Read the paths

    Review paths beginning with `$`. A plus means a value was added, a minus means it was removed, and a tilde means both sides contain different values.

  4. 4

    Export the diff

    Copy the report or download it as text for a review, issue, or API regression record.

How it works

Read a JSON diff carefully

Use valid, representative documents and decide whether array order is meaningful before interpreting a difference. A changed array position may be a real change or only a reordering, while a missing property can differ from a property explicitly set to null. Review numbers, strings, nested objects, and sensitive values in the output. The tool shows structural differences; it does not know whether a change is safe for a business contract or deployment.

Each input is parsed with the same strict JSON rules used by ordinary JavaScript applications. The comparison then walks both values recursively. Objects are matched by property name, arrays by numeric index, and primitive values by their exact parsed value. Every difference is recorded with a JSONPath-like location, making a nested change easier to find than a visual comparison of two large pretty-printed documents.

Object key order is ignored because it is not part of an object value's meaning. Array order is preserved because changing ["draft", "published"] to ["published", "draft"] can change a workflow. This distinction is the important part of a useful API diff: normalize harmless serialization differences without hiding changes in ordered data.

Read the result

An added path exists only in Updated JSON. A removed path exists only in Original JSON. A changed path exists in both but contains different values. Long values are shortened in the visible line so the report stays scannable; use the source panels for the complete values. The cap at 500 paths is a safety boundary, not evidence that later paths are equal.

One numeric edge case gets a deliberate rule rather than a surprise. Positive and negative zero are treated as different values here, even though JavaScript's own === calls them equal — 0 and -0 are both valid JSON, and a sign that flips silently between two API responses is exactly the kind of change a numeric contract should surface rather than hide.

A missing property and a property explicitly set to null are also not the same thing, and the diff keeps them apart. Deleting a field is a removal; setting it to null is a changed value from whatever it held before. Collapsing the two would make it impossible to tell "this API stopped returning the field" from "this API started returning it as empty," which are different bugs with different fixes.

Use it safely

Treat pasted API responses as sensitive. Nothing is stored here — see the FAQ above — but your browser history, screen recordings, extensions, clipboard, and downloaded diff can still expose data after the fact. Remove bearer tokens and personal data before sharing the report. For exact structural review of very large payloads, use a version-controlled or command-line diff with an appropriate data-handling policy.

Examples

Find a changed API field

{"id":42,"status":"pending"} versus {"status":"paid","id":42}
~ $.status: "pending" -> "paid"

The reordered object keys do not create noise; only the meaningful value change remains.

Find an array change

{"items":["a","b"]} versus {"items":["b","a"]}
~ $.items[0]: "a" -> "b" and ~ $.items[1]: "b" -> "a"

Arrays are ordered data, so the tool does not sort them for a prettier but misleading diff.

Frequently asked questions

Does key order matter in the comparison?

No. Object keys are compared as names regardless of their order, so two objects with the same values in different serialization order are treated as equal. Arrays remain ordered because their positions can change meaning.

Is my JSON kept anywhere?

Both documents are parsed and compared on this site's own server, so they are sent over an encrypted connection to do the work — but nothing is written to disk, logged, or retrievable afterward. They exist only for the moment it takes to compute the diff, then the request ends and both are gone. Still worth handling internal identifiers or tokens the same way you would with any tool: remove what you do not need to share before pasting.

Why does the diff stop at 500 paths?

A document with thousands of differences produces an unusable report regardless of where it is rendered. The cap keeps both the comparison and the interface responsive and reports that more paths exist; use a developer diff tool for exhaustive large-payload review.

Can it compare JSON with comments or trailing commas?

No. It uses the standard JSON parser built into JavaScript, so JSON5 comments, trailing commas, and unquoted keys are rejected. Convert the document to strict JSON first rather than silently comparing a different interpretation or hiding a syntax error.