JSON Compare & Diff Online

Free Deep comparison · Color-coded diff · All nesting levels
Diff Result
No comparison yet.

More Developer Tools

JSON Formatter
Format, validate & minify
JSON → YAML
Convert to YAML
JSON → CSV
Array to CSV
JSON → XML
To XML markup
YAML Formatter
Format & validate
Hash Generator
MD5/SHA hashes
JWT Decoder
Decode JWT tokens
Base64
Encode & Decode

What this JSON diff tool compares

Paste two JSON documents and the tool walks both structures in parallel, reporting every difference as an addition, a deletion or a modification, each with the exact path to the changed value. Comparison happens entirely in your browser, so API responses, config files and payloads containing credentials never leave your machine.

The rules below are the ones the tool actually implements — not a general description of JSON diffing. Knowing them in advance is usually faster than comparing and guessing why two documents came out equal when you expected a difference, or the other way round.

The five rules that decide equal or different

1. Object key order does not matter

These two objects are equal — no differences are reported:

{"a":1,"b":2}
{"b":2,"a":1}

JSON objects are unordered by specification, so the tool collects the union of both key sets and compares by key name. This is the most common source of "why did my diff show nothing" — the serialiser that produced one side simply wrote keys in a different order.

2. Array order does matter

Arrays are compared by index, not by identity or by any ID field inside the items:

[1,2]  vs  [2,1]        →  two modifications (index 0 and index 1)
[{"id":1},{"id":2}]  vs  [{"id":2},{"id":1}]
                        →  two modifications, even though both items exist

If you need to compare lists of records where order is meaningless, sort both sides by a stable key before comparing. There is no "match by ID" switch, and that is deliberate: silently reordering data would hide real differences in ordered data such as log lines or test fixtures.

3. Type matters more than looks

A value is only equal if its type matches as well as its content:

1      vs  "1"        →  modification (number vs string)
true   vs  "true"     →  modification
null   vs  false      →  modification
1      vs  1.0        →  equal (both parse to the same number)
[]     vs  {}        →  modification (array vs object)

The 1 vs 1.0 case trips people up. JSON has one numeric type, so after parsing there is no way to tell them apart, and the tool reports them as equal. If your pipeline cares about the literal text, compare the raw strings rather than the parsed values.

4. A missing key is not the same as null

These differ, and the report says so explicitly:

{"a":1}      vs  {"a":1,"b":null}
              →  addition at $.b with value null

{"a":1,"b":null}  vs  {"a":1}
              →  deletion at $.b

In practice this distinction matters most for partial updates: "b": null usually means "clear this field", while an absent b means "leave it alone". A diff that treated them as equal would hide a behavioural difference between two API requests.

5. Whitespace and formatting are irrelevant

Indentation, line breaks, spaces after colons and the presence of a BOM have no effect. Both sides are parsed before comparison, so a minified document and a pretty-printed one with identical content compare equal. If you actually want to compare text layout, use a text diff tool, not this one.

DifferenceReported asTypical cause
Key present on one side onlyaddition / deletionDifferent schema versions, partial payloads
Same key, different valuemodificationData changed between two responses
Same key, different typemodificationSerialiser change, language switch (int vs str)
Array shorter on one sidedeletion per missing indexTruncated results, pagination differences
Key order onlyno differenceDifferent serialiser or map ordering

Comparing nested objects: how paths are built

Every difference carries its exact location. The path syntax follows the shape of the data, so you can copy it straight into a bug report:

PathPoints to
$The whole document
$.server.db.pool.maxNested object keys, joined with dots
$.items[3].priceArray element by index, then a key
$["content-type"]A key that is not a valid identifier is quoted

Given two configuration files:

LEFT                                    RIGHT
{"server":{"port":8080,                {"server":{"port":9090,
  "db":{"pool":{"max":10,                  "db":{"pool":{"max":20,
    "timeout":30}}}}}                        "timeout":30},
                                        "debug":true},
 "items":[1,2,3]}                       "items":[1,2]}

The report lists exactly four changes: $.server.port modified, $.server.db.pool.max modified, $.server.debug added, and $.items[2] deleted. Everything else — including the unchanged $.server.db.pool.timeout — stays out of the report.

The walk is iterative rather than recursive, which is why nesting depth is not a practical limit: a hundred-level object compares the same as a two-level one, with no stack overflow.

Large files: what to expect

The comparison runs in a single pass over both documents, so cost grows linearly with the number of nodes, not with the square of it. Practical notes:

Input sizeBehaviourAdvice
Under 1 MBInstantNo special handling needed
1–10 MBA fraction of a second to a couple of secondsPaste directly; the tab stays responsive
Over 10 MBNoticeable pause while parsingSplit by top-level key first: comparing two 5 MB halves is faster than one 10 MB pair
Pathologically deepHandled — the walk is iterativeOnly parsing limits nesting, not the diff

One caveat that applies to every client-side tool: the browser must hold both parsed documents in memory at once. A 50 MB file on a phone with little free memory will fail at parse time, not at diff time. Nothing is uploaded, so the failure is local and harmless — but it is a failure.

If you frequently compare large payloads, prefer comparing a subset (one top-level key at a time) or an extracted summary, rather than the whole document.

Where a JSON diff is the wrong tool

Two situations look like compare tasks but are better solved differently:

Frequently asked questions

Does JSON Compare ignore object key order?

Yes. Objects with the same keys and values are equal even when the keys appear in a different order, because both sides are parsed into key-value maps before comparison. Array order and value types still matter: 1 and "1" are different.

Why does my diff report differences in an array of objects?

Arrays are compared by index. If two lists contain the same records in a different order, every shifted position is reported as a modification. Sort both sides by a stable key such as id before pasting if order is not meaningful to you.

Can it compare nested JSON objects?

Yes, to any depth. The walk is iterative rather than recursive, so a hundred-level structure compares without hitting a call-stack limit, and every change is reported with its full path such as $.server.db.pool.max.

Is my JSON uploaded anywhere?

No. Parsing, walking and rendering all happen in your browser. No request carries your document, so the tool is safe for API responses, internal configuration and anything containing credentials.

Can I compare JSON arrays?

Yes. Arrays are compared element by element by index, and a shorter array on one side is reported as deletions at the missing indexes. Nested arrays inside objects are handled the same way.

What is the difference between a JSON diff and a text diff?

A text diff compares characters and flags reformatting as a change. A JSON diff parses both sides first, so indentation and key order are ignored and only structural differences are reported. Use a text diff when the file's exact layout matters.

How large a file can it handle?

Comfortably up to a few megabytes and workable up to around ten. The limit is browser memory for the two parsed documents, not the diff algorithm, which grows linearly with the number of nodes. For very large payloads, compare one top-level key at a time.

Why do 1 and 1.0 show as equal?

JSON has a single numeric type. After parsing, 1 and 1.0 are the same value, so no difference is reported. If the literal text matters in your pipeline, compare the source strings instead.

Does a missing key equal a null value?

No. An absent key is reported as a deletion and a key with value null is reported as an addition or a modification. This matters for partial updates, where null usually means "clear" and an absent key means "leave unchanged".

Can I save or share the diff result?

Yes — copy the result to the clipboard or download it as a file. The full result is also encoded in the page URL by the share button, so a colleague opening the link sees the same comparison. Because the payload travels in the URL fragment, it is not sent to a server.

Why This Is the Best JSON Compare Tool

Object key order and array order in JSON

These objects are equal: moving a key does not change its value.

{"a":1,"b":2}
{"b":2,"a":1}

These arrays differ at indexes 0 and 1: array items are compared by position, not by an ID field.

[1,2]
[2,1]

Deep Recursive Comparison

Compares JSON at every nesting level. Handles deeply nested objects, arrays, strings, numbers, booleans and null values with full path reporting.

Color-Coded Diff Output

Differences are color-coded: green for additions, red for deletions, yellow for modifications. Instantly spot what changed between two JSON documents.

Full JSON Path Display

Each difference shows the exact JSON path (e.g., server.db.pool.max) so you know precisely where the change occurred in the structure.

100% Client-Side

All comparison happens in your browser. Your JSON data never leaves your device — ideal for comparing sensitive API responses or config files.

Frequently Asked Questions

Does JSON Compare ignore object key order?

Yes. Objects with the same keys and values are equal even when their keys appear in a different order. Whitespace outside strings does not affect comparison. Array order and value types still matter: 1 and "1" are different.

How does JSON Compare work?

The tool parses both JSON inputs and performs a deep recursive comparison. It identifies added keys, removed keys, and modified values at every nesting level, then displays results with color-coded output.

Can it compare nested JSON objects?

Yes. The comparison is fully recursive and handles deeply nested objects and arrays. Each difference shows the full JSON path (e.g., server.db.pool.max).

Is my data safe?

Absolutely. All processing happens entirely in your browser using JavaScript. No data is ever sent to any server. You can even use it offline once the page is loaded.

Can I compare JSON arrays?

Yes. Arrays are compared element by element (by index). If one array is longer, extra elements are shown as additions or deletions.

In-depth guide
The Complete JSON Guide
Formatting, validation, conversion & best practices
Read the guide