JSON diff

Compare JSON precisely, match array keys, ignore paths and export complete reports.

  • Runs locally
  • Free

Use the tool

Your files are processed in your browser and are not uploaded to a server.

About this tool

Compare two JSON documents precisely, match array items by a unique key, ignore specific paths, filter differences by type, locate source values and export a complete JSON diff report.

Typical uses

  • Compare old and new API responses
  • Check whether two environments share the same config
  • Verify records before and after a data migration

How to use

  1. Paste or import both JSON documents. Compare exact numeric values or number literals; optionally match one array by a unique key and ignore exact paths.

  2. Compare, filter differences and locate source values. The page shows 500 differences; copy or download the complete JSON report and save rule presets.

Good to know

Per side: 1M characters / 4 MiB file, 128 levels and 50K keys/values. Duplicate object keys and missing or duplicate match keys are errors. Key matching affects one specified array; other arrays use positions. Up to 32 exact JSON Pointers skip subtrees by original paths on either side. Complete reports allow 10K differences / 5M characters; over-budget reports are rejected, never truncated. Cancellable with an 8-second deadline.

Reading the result: paths, type changes and strings

Every difference is located with a JSON Pointer (RFC 6901): a / inside a key is written ~1, a ~ is written ~0, an empty-string key is a lone /, and the whole document is shown as “(root)”. The table was computed by the tool’s comparison engine:

Left (before)Right (after)ResultNote
{"a":1,"b":2}{"b":2,"a":1}Equal under the current rulesKey order inside objects does not matter
{"a/b":1,"c~d":2,"":3}{"a/b":2,"c~d":3,"":4}Changed /a~1b: 1 → 2 · Changed /c~0d: 2 → 3 · Changed /: 3 → 4Escaping: a/b → /a~1b, c~d → /c~0d, empty key → /
[]{}Changed (root): [] → {}A type change is reported once and not compared further
{"v":"1"}{"v":1}Changed /v: "1" → 1The string "1" and the number 1 are different types
{"v":null}{"v":{"x":1}}Changed /v: null → {"x":1}null became an object: the whole object is shown as the new value
{"a":1}{"a":1,"b":[1,2]}Added /b: [1,2]An added value has only a right-hand path; the whole array is one addition
{"s":"\u00e9"}{"s":"é"}Equal under the current rulesStrings are compared after unescaping, so \u00e9 equals é
{"s":"é"}{"s":"é"}Changed /s: "é" → "é"No Unicode normalization, though: precomposed é differs from e plus a combining accent
  • Values in the list are slices of the original JSON text (up to 240 characters shown); “Locate left” and “Locate right” select the full value in the editor. In the JSON report from “Download full report” values are also stored as raw text, so large numbers and long decimals are never rewritten.
  • Children of a changed node are not listed separately: when an object turns into an array or null into an object, there is one “Changed” at that path.
  • The page shows up to 500 differences and can filter by type or by part of a path; the report contains all of them.

Numbers: exact value or literal text

“Numbers” defaults to “Exact value (1 = 1.0)”: each literal is split into significant digits and a decimal exponent and compared that way, without ever becoming a JavaScript float. “Literal (1 ≠ 1.0)” compares the text character by character. The last column shows whether plain JavaScript Number() turns both literals into the same float:

LeftRightExact value (1 = 1.0)Literal (1 ≠ 1.0)Number() result
11.0=≠same
1.501.5=≠same
1e2100=≠same
0.11E-1=≠same
-00=≠same
90071992547409939007199254740992≠≠same
0.123456789012345678900.12345678901234567891≠≠same
123456789012345678901.2345678901234567890e19=≠same
  • 9007199254740993 and 9007199254740992 are above 2^53 and become the same float in most programs; this tool still reports the change, so an edited long integer ID is not missed.
  • Under “Exact value”, 1, 1.0, 1.50 and 1.5, 1e2 and 100, and -0 and 0 are all equal. To catch formatting changes (a serializer that now writes a different number of decimals), switch to “Literal”.
  • Numbers whose exponent has more than 1,000 digits are refused, so a crafted input cannot exhaust the comparer.

Arrays: by position or matched by key

The default “By position” compares item 0 with item 0, item 1 with item 1 and so on, so inserting one item at the start reports every later position as changed. With “Match one array by key”, the one array named in “Array pointer” is paired up by “Key pointer (relative to item)” and its order is ignored. Here is the “Load example” data under both settings, plus other cases:

LeftRightResultSettings
{ "items": [{"id": 1, "name": "Doc80", "price": 0.12345678901234567890}, {"id": 2, "name": "JSON"}], "updatedAt": "2026-01-01" }{ "items": [{"id": 2, "name": "JSON"}, {"id": 1, "name": "Doc80 Tools", "price": 0.12345678901234567891}], "updatedAt": "2026-01-02" }Changed /items/0/id: 1 → 2 · Changed /items/0/name: "Doc80" → "JSON" · Removed /items/0/price: 0.12345678901234567890 · Changed /items/1/id: 2 → 1 · Changed /items/1/name: "JSON" → "Doc80 Tools" · Added /items/1/price: 0.12345678901234567891 · Changed /updatedAt: "2026-01-01" → "2026-01-02"By position
{ "items": [{"id": 1, "name": "Doc80", "price": 0.12345678901234567890}, {"id": 2, "name": "JSON"}], "updatedAt": "2026-01-01" }{ "items": [{"id": 2, "name": "JSON"}, {"id": 1, "name": "Doc80 Tools", "price": 0.12345678901234567891}], "updatedAt": "2026-01-02" }Changed /items/0/name → /items/1/name: "Doc80" → "Doc80 Tools" · Changed /items/0/price → /items/1/price: 0.12345678901234567890 → 0.12345678901234567891 · Changed /updatedAt: "2026-01-01" → "2026-01-02"Arrays = Match one array by key, /items, /id
{ "items": [{"id": 1, "name": "Doc80", "price": 0.12345678901234567890}, {"id": 2, "name": "JSON"}], "updatedAt": "2026-01-01" }{ "items": [{"id": 2, "name": "JSON"}, {"id": 1, "name": "Doc80 Tools", "price": 0.12345678901234567891}], "updatedAt": "2026-01-02" }Changed /items/0/name → /items/1/name: "Doc80" → "Doc80 Tools" · Changed /items/0/price → /items/1/price: 0.12345678901234567890 → 0.12345678901234567891 · Skipped subtrees 1Same, ignoring /updatedAt
[1,2,3][0,1,2,3]Changed /0: 1 → 0 · Changed /1: 2 → 1 · Changed /2: 3 → 2 · Added /3: 3By position: 0 inserted at the start
{"tags":["a","b"]}{"tags":["b","a","c"]}Added /tags/2: "c"Array pointer /tags with an empty key pointer: a list of strings treated as a set
[{"id":"A1"}][{"id":"A1"},{"id":"B2"}]Added /1: {"id":"B2"}Empty array pointer: the root array
{"items":[{"id":1},{"id":"1"}]}{"items":[{"id":1}]}Removed /items/1: {"id":"1"}The number 1 and the string "1" are different keys
{"items":[{"id":1},{"id":1.0}]}{"items":[]}Left: Duplicate array match keys prevent unique pairing. (/items/1/id)Under “Exact value” 1 and 1.0 are the same key, hence a duplicate
{"items":[{"id":1}]}{"items":[{"id":1.0}]}Removed /items/0: {"id":1} · Added /items/0: {"id":1.0}Under “Literal” 1 and 1.0 are different keys: one removal, one addition
{"items":[{"id":1,"tags":["x","y"]}]}{"items":[{"id":1,"tags":["y","x"]}]}Changed /items/0/tags/0: "x" → "y" · Changed /items/0/tags/1: "y" → "x"Only /items is matched by key; the tags inside each item are still compared by position
  • When items are matched by key, the same item can sit at different indexes on each side, so the path is written left → right, for example /items/0/name → /items/1/name.
  • The key must exist, be a string, number, boolean or null, and be unique on each side. Otherwise the comparison stops with an error instead of falling back to positions.
  • Only one array can be matched by key. Every other array, including arrays inside the matched items, is compared by position.

Ignored paths and error messages

A path in “Ignored paths (one JSON Pointer per line)” must equal a difference path exactly; when it matches, the whole subtree is skipped and counted under “Skipped subtrees”. There are no wildcards:

LeftRightResultNote
{"updatedAt":"2026-01-01","meta":{"etag":"a1","size":2}}{"updatedAt":"2026-01-02","meta":{"etag":"b7","size":3}}Changed /meta/size: 2 → 3 · Skipped subtrees 2Ignoring /updatedAt and /meta/etag leaves only the size change
{"a":{"b":1}}{"a":{"b":2}}Changed /a/b: 1 → 2Ignoring /a/*: the * is read as a key named “*”, so nothing is skipped
{"a":1}{"a":2}Invalid rules. Use JSON Pointers; up to 32 ignored paths and 1,500 characters.Ignoring a: it does not start with /, so the rules are invalid
{"items":[{"id":1,"v":1},{"id":2,"v":2}]}{"items":[{"id":2,"v":5},{"id":1,"v":9}]}Equal under the current rules · Skipped subtrees 2Matched by key, ignoring /items/0/v skips v of left index 0 (id 1) and of right index 0 (id 2)
Index-based ignore paths and key matching

Ignore paths are checked against each side’s original path, and a match on either side skips the node. After key matching, one index can name different items on the two sides, which is why the last row skipped v for both items. To ignore a field in every item, remove it with a JSON tool before comparing.

Common errors (the path in brackets is where the problem is):

Input (left)MessageCause
{"sku":"A","sku":"B"}Left: Duplicate object keys are ambiguous. Resolve duplicates before comparing.The same key appears twice in one object, so there is no single value to compare
{"data":[]}Left: The specified array path is missing or is not an array on this side. (/items)Key matching is on, but the default array pointer /items does not exist in this data; change it to /data
{"items":[{"name":"a"}]}Left: The match key is missing or is not a string, number, boolean or null. (/items/0/id)An item has no id field; the path in the message is where it was looked for
{"items":[{"id":7},{"id":7}]}Left: Duplicate array match keys prevent unique pairing. (/items/1/id)Two items share the same id and cannot be paired one to one
—Invalid rules. Use JSON Pointers; up to 32 ignored paths and 1,500 characters.A path does not start with /, a ~ is not followed by 0 or 1, or there are more than 32 ignore paths or 1,500 characters
—More than 10,000 differences or a report over 5,000,000 characters. Reduce input; no partial report was produced.With more than 10,000 differences the whole comparison fails rather than returning part of the result
—Comparison exceeded 8 seconds and was stopped. Reduce input and retry.The comparison runs in a background worker that is stopped after 8 seconds

Both sides must be strict JSON: comments and trailing commas are syntax errors and are marked in the editor. Fix them with the JSON formatter and validator.

Sources

Frequently asked questions

Does a changed array order count as a difference?

Arrays compare by position by default. Specify a unique key for one array to match items regardless of order.

Can I ignore fields like timestamps?

Yes. Up to 32 JSON Pointer paths can be skipped.

What if there are many differences?

The page shows 500; complete reports allow 10,000. Over-budget reports are rejected rather than truncated.