Compare JSON Online – JSON Comparison Tool

Paste or open two JSON documents and see what changed: added, removed and modified keys, with options to ignore array order and chosen keys.

JSON 1

JSON 2

Options

Compares arrays as unordered collections, so reordered items are not differences.

Pairs objects in arrays by this field, so a changed item shows its changed fields. Needs Ignore array order.

Comma or line separated. A name is ignored at any depth, a path with dots starts at the root, and * matches any key or index.

Compare Two JSON Files Online

JSON Compare is a free online tool that compares two JSON documents and lists every difference between them: keys that were added, keys that were removed, values that changed and values whose type changed. Each difference comes with its path and its RFC 6901 JSON Pointer, and the tool can write all of them as an RFC 6902 JSON Patch that turns the first document into the second. It is useful for developers working with APIs, configuration files and any JSON data where accuracy and consistency matter.

By default the comparison is strict and structural: key order never matters, array order does. Three optional switches relax that when your data needs it. Ignore array order treats arrays as unordered collections, Match array items by key pairs the objects inside arrays by a field such as id, and Ignore keys drops fields such as updatedAt before comparing. All three are off until you turn them on, so the default result is the one this page has always given.

How the JSON Compare Tool Works

  • Add both documents: paste them, use Paste, open a .json or .txt file for each side with Open file, or drop a file on an editor. Load sample fills both sides with an example pair.
  • Choose options (optional): ignore array order, match array items by key, and ignore keys.
  • Press Compare: both documents are validated first. If one is invalid, the message says which side and where, and the other side is left untouched.
  • Read the result: a summary with counts, the list of differences with paths and JSON Pointers, and the JSON Patch.
  • Copy or download: copy the summary, copy the patch, or download it as patch.json.

What does a JSON diff compare?

A JSON diff walks both documents together. Objects are compared key by key, so a key that exists only on the left is removed, a key that exists only on the right is added, and a key on both sides is compared again at the next level. The order of keys never matters, and neither do whitespace or indentation, so a minified file and a pretty-printed copy of the same data are identical.

Values are compared by type and then by value. The number 1 and the string "1" are different, and the summary counts that as a type change, not a changed value. null is its own type, and an object compared with an array, or with null, is also a type change. A change of value inside the same type, such as 1.4.0 becoming 1.5.0, is a changed value. The summary shows Added, Removed, Changed, Type changed and Same, where Same counts the values that matched.

Arrays are compared by position by default. Item 0 is compared with item 0, item 1 with item 1, and so on, and an item that exists on only one side is added or removed. That is the right behaviour when order carries meaning, but it also means that inserting one item at the start of a list makes every later item look changed, which is what the next section is for.

How do I ignore array order and match items by key?

Turn on Ignore array order to compare arrays as unordered collections. Add a field name such as id under Match array items by key when the arrays hold objects, so an item that changed is shown as changed fields instead of one removed item and one added item.

With Ignore array order on, every array element is turned into a canonical text in which object keys are sorted and nested arrays are sorted too. Equal texts cancel each other one for one, and whatever is left on the left is reported as removed while whatever is left on the right is reported as added. Primitive arrays therefore compare as multisets: duplicates count, so [1, 1, 2] against [1, 2, 2] gives one removed 1 and one added 2.

Here is a pair of documents whose users array has the same three people in a different order, and where Linus changed from viewer to editor.

JSON 1

{
  "users": [
    {
      "id": 1,
      "name": "Ada",
      "role": "admin"
    },
    {
      "id": 2,
      "name": "Grace",
      "role": "editor"
    },
    {
      "id": 3,
      "name": "Linus",
      "role": "viewer"
    }
  ]
}

JSON 2

{
  "users": [
    {
      "id": 3,
      "name": "Linus",
      "role": "editor"
    },
    {
      "id": 1,
      "name": "Ada",
      "role": "admin"
    },
    {
      "id": 2,
      "name": "Grace",
      "role": "editor"
    }
  ]
}

In the default ordered mode almost everything looks different, because position 0 now holds a different user:

Default (arrays compared by position)

Changed users[0].id  /users/0/id: 1 β†’ 3
Changed users[0].name  /users/0/name: "Ada" β†’ "Linus"
Changed users[0].role  /users/0/role: "admin" β†’ "editor"
Changed users[1].id  /users/1/id: 2 β†’ 1
Changed users[1].name  /users/1/name: "Grace" β†’ "Ada"
Changed users[1].role  /users/1/role: "editor" β†’ "admin"
Changed users[2].id  /users/2/id: 3 β†’ 2
Changed users[2].name  /users/2/name: "Linus" β†’ "Grace"
Changed users[2].role  /users/2/role: "viewer" β†’ "editor"
Summary: added 0, removed 0, changed 9, type changed 0, same 0

With Ignore array order on, the two unchanged users cancel out. Linus changed, so his old and new objects are not equal, and they are reported as one removed and one added item:

Ignore array order on

Added   users[0]  /users/0: {"id":3,"name":"Linus","role":"editor"}
Removed users[2]  /users/2: {"id":3,"name":"Linus","role":"viewer"}
Summary: added 1, removed 1, changed 0, type changed 0, same 6

Add the key id under Match array items by key and the old and new Linus objects are paired by id and compared deeply, so the result is the single change that actually happened:

Ignore array order on, Match array items by key: id

Changed users[2].role  /users/2/role: "viewer" β†’ "editor"
Summary: added 0, removed 0, changed 1, type changed 0, same 8

An item that has no such field falls back to the multiset rule, and so do items whose key value has no partner on the other side. The key is compared by type and value, so id 1 and id "1" are different keys. If several items share a key value they are paired in the order they appear. Match by key only applies when Ignore array order is on. With unordered arrays, a position in a path is the position in the first document for removed and changed items and the position in the second document for added items.

A list of plain values works the same way. Here one extra "v1" appears on the right, in a different position:

JSON 1, then JSON 2

{"tags": ["billing", "internal", "v1"]}
{"tags": ["v1", "billing", "internal", "v1"]}

Default

Added   tags[3]  /tags/3: "v1"
Changed tags[0]  /tags/0: "billing" β†’ "v1"
Changed tags[1]  /tags/1: "internal" β†’ "billing"
Changed tags[2]  /tags/2: "v1" β†’ "internal"
Summary: added 1, removed 0, changed 3, type changed 0, same 0

Ignore array order on

Added   tags[3]  /tags/3: "v1"
Summary: added 1, removed 0, changed 0, type changed 0, same 3

How do ignored keys and paths work?

Type the keys to ignore under Ignore keys, separated by commas or new lines. A name without a dot, such as updatedAt, is ignored at any depth. An entry with dots, such as meta.requestId, is a path from the root. A * in a path matches any key or any array index, as in items.*.seen.

Ignored keys are removed from both documents before they are compared, so they never appear in the differences, the counts or the patch, and a key that exists on only one side is ignored on both. The documents in the editors are not changed. Fields such as timestamps, request ids and tokens differ on every run and hide the changes you care about, which is why ignoring them is the usual first step in an API response comparison.

JSON 1

{
  "id": 42,
  "name": "Ada",
  "updatedAt": "2026-09-01T10:00:00Z",
  "meta": {
    "requestId": "a1b2",
    "source": "api"
  }
}

JSON 2

{
  "id": 42,
  "name": "Ada",
  "updatedAt": "2026-10-01T09:30:00Z",
  "meta": {
    "requestId": "c3d4",
    "source": "api"
  }
}

Nothing ignored, two differences, and only one of them matters:

Ignore keys: empty

Changed updatedAt  /updatedAt: "2026-09-01T10:00:00Z" β†’ "2026-10-01T09:30:00Z"
Changed meta.requestId  /meta/requestId: "a1b2" β†’ "c3d4"
Summary: added 0, removed 0, changed 2, type changed 0, same 3

Ignoring the name updatedAt removes it at every depth:

Ignore keys: updatedAt

Changed meta.requestId  /meta/requestId: "a1b2" β†’ "c3d4"
Summary: added 0, removed 0, changed 1, type changed 0, same 3

Adding the path meta.requestId removes the last difference:

Ignore keys: updatedAt, meta.requestId

Identical: no differences
Summary: added 0, removed 0, changed 0, type changed 0, same 3

A star in a path covers every element of an array. With the entry items.*.seen, the seen field of each item is ignored and only the real change remains:

JSON 1

{"items":[{"id":1,"seen":"a"},{"id":2,"seen":"b"}],"total":2}

JSON 2

{"items":[{"id":1,"seen":"x"},{"id":2,"seen":"y"}],"total":3}

Ignore keys: empty

Changed items[0].seen  /items/0/seen: "a" β†’ "x"
Changed items[1].seen  /items/1/seen: "b" β†’ "y"
Changed total  /total: 2 β†’ 3
Summary: added 0, removed 0, changed 3, type changed 0, same 2

Ignore keys: items.*.seen

Changed total  /total: 2 β†’ 3
Summary: added 0, removed 0, changed 1, type changed 0, same 2

Keys are matched by their exact name, and a key that itself contains a dot cannot be addressed by a path. An entry that ignores an array index removes that element, which shifts the later ones.

How do I read the JSON Patch output?

The patch is an RFC 6902 JSON Patch: a list of add, remove and replace operations, each with a JSON Pointer path, that turns the first document into the second. Copy it or download it as patch.json.

A JSON Pointer names a place in a document with slashes: /owner/email is the email key inside owner, and /tags/2 is the third item of the tags array. A slash inside a key is written ~1 and a tilde is written ~0, so the key a/b becomes /a~1b. Here is a pair of documents, the patch the tool produces for them, and the result of applying that patch to the first document, which equals the second.

JSON 1

{
  "name": "orders-api",
  "version": "1.4.0",
  "debug": true,
  "owner": {
    "team": "platform"
  },
  "tags": [
    "billing",
    "internal"
  ]
}

JSON 2

{
  "name": "orders-api",
  "version": "1.5.0",
  "owner": {
    "team": "platform",
    "email": "billing@example.com"
  },
  "tags": [
    "billing",
    "internal",
    "v1"
  ]
}

JSON Patch

[
  {"op":"replace","path":"/version","value":"1.5.0"},
  {"op":"remove","path":"/debug"},
  {"op":"add","path":"/owner/email","value":"billing@example.com"},
  {"op":"add","path":"/tags/2","value":"v1"}
]

JSON 1 after the patch is applied

{
  "name": "orders-api",
  "version": "1.5.0",
  "owner": {
    "team": "platform",
    "email": "billing@example.com"
  },
  "tags": [
    "billing",
    "internal",
    "v1"
  ]
}

The operations are in an order that works when they are applied one after another. When arrays shrink, the removals go from the end first, so an earlier removal never shifts the index of a later one:

JSON 1

{"queue": ["a", "b", "c", "d"]}

JSON 2

{"queue": ["a", "x"]}

JSON Patch

[
  {"op":"replace","path":"/queue/1","value":"x"},
  {"op":"remove","path":"/queue/3"},
  {"op":"remove","path":"/queue/2"}
]

A key that contains special characters is escaped in the pointer. Comparing {"a/b": 1, "m~n": 1} with {"a/b": 2, "m~n": 2} gives:

JSON Patch

[
  {"op":"replace","path":"/a~1b","value":2},
  {"op":"replace","path":"/m~0n","value":2}
]

With Ignore array order on, the patch makes the first document equal to the second up to array order: items that only moved need no operation, items that were removed are removed by their index in the first document, and new items are appended with the "-" index. Ignored keys are not part of the patch, and the patch is only produced when both sides hold a document.

What is a JSON comparison useful for?

The most common use is an API regression check: save a response before a change, save another after, and compare them with the volatile fields ignored. Configuration drift is the second: compare the settings of staging and production, or a file in version control against the one deployed. Test fixtures are the third, where a snapshot of expected output is compared with the actual output and the patch documents exactly what moved. A fourth is checking a data migration, comparing a record before and after it was transformed.

With the sample pair loaded and every option off, the tool finds 21 differences, mostly because the users and tags arrays were reordered. With Ignore array order on there are 12. With Ignore array order, Match array items by key set to id and Ignore keys set to updatedAt, only the 6 real changes are left: the added region, the removed debug flag, the new version, the timeout that became a string, the new owner email and Linus's new role.

Common mistakes when comparing JSON

Comparing a pretty-printed file with a minified one is fine, because formatting is never compared. Key order is never a difference either, so there is no need to sort keys first, although the JSON Sorter helps when you also diff the files as plain text. Array order is a difference by default, so a list returned in a different order shows up as many changes until you turn on Ignore array order. Turning that option on for a list where order matters, such as steps in a pipeline, hides real changes. Forgetting to ignore volatile keys is the other frequent mistake: a timestamp that differs on every call buries the changes that matter.

Limits and what is not compared

Each side can hold up to 25 MB of JSON. Numbers are compared as JavaScript numbers, so two integers that differ only beyond about 15 significant digits count as equal. Duplicate keys inside one object are not reported, because the last one wins when the JSON is read. Comments and trailing commas are not valid JSON and are rejected with a line and column. The comparison looks at data, not at text, so it does not tell you which line moved. A very long list of differences shows the first 400 of each kind, and the counts and the patch always include all of them.

Privacy & Security

All JSON comparison happens entirely in your browser. We do not upload, store, log, or share your JSON data. Your information remains private and secure at all times.

What automated diffs do not tell you

In JSON, object key order usually does not change meaning, but a line-by-line diff can still show keys as β€œmoved,” which is why it helps to sort both documents with the same key order before comparing. Floating-point values may differ slightly between languages or serializers. Arrays are ordered by defaultβ€”if order matters for your API contract, treat reordering as a real change. For workflows (when to snapshot responses, how to normalize before comparing), read How to Compare JSON. To compare two configuration files kept in YAML, convert each one with the YAML to JSON converter first and paste both results here.

JSON Comparison Tool - Compare Two JSON Objects

Our online JSON comparison tool allows you to compare two JSON objects side-by-side and instantly identify differences. Whether you're comparing API responses, validating backend changes, debugging production issues, or performing QA regression testing, our tool makes it easy to spot what changed.

Side-by-Side Comparison

Compare two JSON objects in a split-screen view with syntax highlighting. See both JSONs simultaneously for easy visual comparison.

Visual Highlighting

Added, removed, and changed keys are automatically highlighted with color-coded indicators. Quickly identify what's different between your JSONs.

Detailed Difference Report

Get a comprehensive report showing all differences with paths, JSON Pointers, old values, and new values. Perfect for documentation and debugging.

Summary Statistics

See at a glance how many keys were added, removed, changed, changed in type, or remained the same. Get instant insights into your JSON differences.

Ignore Array Order

Compare arrays as unordered collections, optionally pairing objects by a key such as id, so reordered lists are not reported as changes.

Ignore Keys

Leave out fields such as updatedAt by name, by path from the root, or with a * wildcard, before the two documents are compared.

JSON Patch Output

Copy or download an RFC 6902 patch with JSON Pointer paths that turns the first document into the second.

Use Cases for JSON Comparison

βœ“ Compare API Responses

Compare API responses before and after changes to ensure backward compatibility and identify breaking changes. Perfect for API versioning and migration testing.

βœ“ Validate Backend Changes

Compare JSON output from different backend versions to validate that changes don't break existing functionality. Essential for continuous integration and deployment pipelines.

βœ“ Debug Production Issues

Compare production JSON data with expected values to quickly identify discrepancies and root causes of issues. Save time debugging complex data problems.

βœ“ QA Regression Testing

Compare JSON outputs from test runs to detect regressions and ensure new features don't break existing functionality. Streamline your QA process.

βœ“ Configuration Management

Compare configuration files across environments (dev, staging, production) to ensure consistency and identify environment-specific differences.

βœ“ Data Migration Validation

Compare JSON data before and after migration to ensure data integrity and completeness. Verify that all fields are correctly transformed.

Frequently Asked Questions

Does the order of keys affect the comparison?

No β€” the comparison is semantic, not text-based. {"name": "Alice", "age": 30} and {"age": 30, "name": "Alice"} are treated as identical, since JSON objects are inherently unordered. Only actual value differences are flagged.

Can I compare minified and pretty-printed JSON?

Yes. Formatting, whitespace, and indentation are ignored entirely β€” only the underlying data structure and values are compared, so a minified file and a pretty-printed version of the same data will show no differences.

Is my JSON data uploaded anywhere during comparison?

No. Both files are compared entirely in your browser β€” nothing is sent to a server at any point, which matters if you're comparing API responses or config files containing real data.

How do I compare two JSON files when the arrays are in a different order?

Turn on Ignore array order. Arrays are then compared as unordered collections, so reordered items are not differences, and duplicates are counted. If the items are objects with an id, also fill in Match array items by key so a changed item shows its changed fields instead of one removed and one added item.

How do I ignore fields such as updatedAt when comparing JSON?

Type the names under Ignore keys, separated by commas or new lines. A name such as updatedAt is ignored at any depth. A path with dots such as user.updatedAt starts at the root, and * matches any key or array index, as in items.*.updatedAt. Ignored keys are removed from both documents before they are compared.

What is the JSON Patch output?

It is an RFC 6902 patch, a list of add, remove and replace operations with JSON Pointer paths, that turns the first document into the second. Copy it or download it as patch.json. With Ignore array order on, the patch makes the first document equal to the second up to array order, and ignored keys are never in the patch.

How large a JSON file can I compare?

Each side can be up to 25 MB. Files over about 1 MB are not placed in the editor and are compared straight from the file in a background worker, so the page stays responsive, and a Cancel button appears if it takes longer than a second. A long list of differences shows the first 400 of each kind, while the counts and the patch include all of them.