DEVELOPER TOOL

JSON Diff & JSON Compare

Compare two JSON objects and instantly find added, removed, and changed fields. Structural comparison β€” not text diff. Everything runs in your browser.

πŸ”’ Processed locally β€” nothing uploaded

What is JSON Diff?

JSON Diff is the process of comparing two JSON documents and reporting exactly which parts changed. Unlike a plain text diff that compares lines or characters, a JSON diff understands the structure of the data: it sees objects, arrays, keys, values, and types. That means it can tell you that user.age changed from 25 to 26, that user.email was added, and that user.phone was removed β€” even if the two JSON files are formatted with different indentation, different key ordering, or a completely different number of whitespace characters.

A JSON compare tool is what you reach for when you want to answer questions like: "What changed between these two API responses?", "Did my config change anything meaningful?", "Which field is causing my tests to fail?" Compare JSON objects structurally and you get a clean, readable list of changes instead of a wall of red and green lines.

This tool runs entirely in your browser. Your JSON is never uploaded, never logged, and never sent to any third-party service. You can safely paste production API responses, config files, or fixtures β€” the comparison happens locally, and closing the tab erases everything.

How to compare JSON

The workflow is deliberately simple:

  1. Paste the original JSON into JSON A.
  2. Paste the modified JSON into JSON B.
  3. Pick your comparison options (key order, array mode, strict mode).
  4. Click Compare JSON.
  5. Review the summary and filter the results by Added, Removed, or Changed.

The comparison is structural, not textual. Two documents that mean the same thing are reported as identical, no matter how differently they're formatted. This is the key difference between a real JSON Difference Checker and a naive line-based diff.

JSON Diff example

Consider these two JSON objects:

{
  "name": "John",
  "age": 25
}
{
  "name": "John",
  "age": 26,
  "email": "john@example.com"
}

A structural JSON diff produces three findings:

  • Unchanged: name β€” both documents have "John".
  • Changed: age β€” 25 β†’ 26.
  • Added: email β€” present only in JSON B.

Paste the two objects into the editors above and click Compare to see the same result live.

What changes does JSON Diff detect?

A structural comparison reports six kinds of difference. Each one carries a JSON path, so you always know exactly where the change lives β€” even in a deeply nested document.

Added fields

A key that exists in JSON B but not in JSON A. The path is reported and the value is shown once.

JSON A: { "user": { "name": "John" } }
JSON B: { "user": { "name": "John", "email": "john@example.com" } }

Result: user.email β€” added ("john@example.com")

Removed fields

A key that exists in JSON A but not in JSON B. The path is reported and the old value is shown once.

JSON A: { "user": { "name": "John", "phone": "+1-555-0100" } }
JSON B: { "user": { "name": "John" } }

Result: user.phone β€” removed ("+1-555-0100")

Changed values

A key present in both documents whose value differs. Both the old and new values are shown side by side.

JSON A: { "user": { "age": 25 } }
JSON B: { "user": { "age": 26 } }

Result: user.age β€” changed (25 β†’ 26)

Type changes

A key that exists in both documents but with a different JSON type: number β†’ string, boolean β†’ null, object β†’ array, and so on. Type changes are reported as a single changed entry with both types labelled, so you don't have to guess what happened.

JSON A: { "age": 30 }
JSON B: { "age": "30" }

Result: age β€” changed (30 β†’ "30", number β†’ string)

Nested JSON changes

Nested objects are recursed into, so you get the exact leaf path rather than a top-level "object differs" message.

JSON A: { "user": { "profile": { "address": { "city": "New York" } } } }
JSON B: { "user": { "profile": { "address": { "city": "San Francisco" } } } }

Result: user.profile.address.city β€” changed ("New York" β†’ "San Francisco")

This is what makes a structural diff genuinely readable for real-world payloads: real APIs nest five or six levels deep, and a tool that stops at the top of the tree is useless.

Array changes

Arrays are compared by position by default, so added, removed, and changed items are reported with their index β€” for example users[1].name or items[3] β€” added. If you switch to Ignore order, the tool tries to match items by an identifier (id, _id, key, name, uuid, slug) if one exists, then falls back to deep equality, so reordered arrays don't produce noise.

JSON Diff for API responses

The most common use of a JSON API response diff is to answer the question: "What did the server change since the last time I called it?" You can paste the previous response into JSON A and the current response into JSON B, click Compare, and get a precise list of the differences β€” no more eyeballing two huge blobs of text.

This is also useful when:

  • You upgraded a backend and want to confirm nothing unintended changed in the response shape.
  • You're debugging a flaky integration where one environment returns different data than another.
  • You're capturing a "golden" response and want to detect drift over time.
  • You're diffing two API versions to see exactly what broke between v1 and v2.

If you built the request in the API Request Builder, copy the response body straight into one of the editors above. If the response contains Unix timestamps, the Unix Timestamp Converter will help you read them as real dates. And if you need to reshape the JSON once you know what changed, the Universal Data Transformer is one click away.

JSON Diff vs text diff

A text diff compares the byte sequence or line sequence of two files. It's perfect for source code, changelogs, and prose, but it's a poor fit for JSON for one simple reason: JSON has many valid representations of the same value.

For example, these two documents are semantically identical:

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

A line-based diff will report the entire file as changed. A structural JSON diff will report that the two documents are identical. That difference matters as soon as you're comparing machine-generated output: JSON serializers don't guarantee key order, indentation, or whitespace, so a text diff against serialized JSON produces false positives on almost every run.

A structural diff also understands types. A text diff sees 30 and "30" as similar strings; a JSON diff sees them as different types and flags the change explicitly. That's what you actually want when you're debugging a validation error caused by a string where a number was expected.

Common JSON comparison use cases

  • API response regression β€” capture a known-good response, then compare against every subsequent call in CI.
  • Configuration file diffs β€” compare config.json across environments (dev, staging, prod) to catch drift.
  • Fixture comparison β€” when a test starts failing, diff the expected fixture against the actual result.
  • Schema evolution β€” check what a backend added, removed, or renamed between two versions.
  • JWT payload comparison β€” decode two JWTs and see what claims changed. Use the JWT Debugger to decode them first.
  • Data migrations β€” verify that a migration produced the expected shape in the destination.
  • Localization and content review β€” compare two language files for missing or stale keys.
  • Cache inspection β€” diff cached and fresh responses to find stale entries.
  • Third-party API upgrades β€” compare responses before and after a vendor SDK bump.
  • Debugging webhooks β€” diff the body of a successful webhook against a failing one.

JSON formatting and key order

JSON is defined by RFC 8259, which explicitly states that objects are unordered collections of name/value pairs. Two objects with the same keys in different orders are the same object. A correct online JSON comparator respects this by default: the "Ignore key order" option is on, and reordered keys are not reported as changes.

If you actually do care about key order β€” for example, because a downstream consumer serializes in a fixed order β€” turn on Strict mode. That flips the comparison to order-sensitive. In practice this is rare, but it's occasionally useful when comparing golden files produced by a specific serializer.

Formatting β€” indentation, line breaks, trailing whitespace β€” is never treated as a difference. The tool parses both inputs and compares the resulting values, so a minified document and its pretty-printed twin compare as identical.

Invalid JSON

Before comparing, the tool parses both inputs. If either one is invalid JSON, you get a specific error message with the line, column, and the parser's reason β€” not a generic "Invalid JSON" toast. Common cases the tool catches:

  • Missing quotes around keys or string values.
  • Trailing commas at the end of objects or arrays.
  • Unbalanced braces or brackets.
  • Single-quoted strings (valid in JavaScript, invalid in JSON).
  • Unescaped control characters inside strings.
  • Empty input or whitespace-only input.

When the browser's JSON parser reports a position, the tool converts it to a line and column and shows both, so you can jump straight to the offending character.

Privacy and security

JSON often contains production data: user records, tokens, API keys, configuration values, and personally identifiable information. This tool is designed around that reality:

  • All comparison happens in your browser using plain JavaScript. Nothing is sent to a server.
  • Your JSON is never logged, never stored, never sent to analytics.
  • No accounts, no signup, no cookies required to run a comparison.
  • Closing the tab discards everything.

The only outbound request the tool can make is the optional "Send JSON A/B to Transformer" action, which passes the JSON to another page in this same site via your browser's session storage. No server sees the content.

Related developer tools

Frequently asked questions

Is this JSON diff tool free?

Yes. No signup, no account, no rate limit. The whole tool runs client-side.

Does it upload my JSON anywhere?

No. Comparison is performed entirely in your browser. Your JSON never leaves the page unless you explicitly choose to send it to the Universal Data Transformer (which is also fully client-side).

Does key order matter?

By default, no. The tool respects the JSON spec's definition that objects are unordered. You can enable Strict mode if you want key order to be treated as significant.

How are arrays compared?

By default, arrays are compared by position β€” a[0] against b[0], and so on. You can switch to Ignore order, which tries to match items by an identifier field (id, _id, key, name, uuid, slug) before falling back to deep equality.

Does formatting or whitespace count as a difference?

No. Two documents with the same content but different indentation, line breaks, or key ordering compare as identical (unless strict mode is on).

What does "Strict mode" actually change?

Strict mode makes key order significant and ensures type mismatches are always reported as changes. In normal mode, key order is ignored because JSON objects are unordered by definition.

Can it handle large JSON documents?

Yes, up to the practical limits of your browser tab. Comparison is done with a single recursive pass; for documents in the multi-megabyte range you may notice a brief pause. The tool shows a loading indicator during the comparison so the page doesn't feel frozen.

Can I compare JSON files?

Yes β€” open each file in a text editor, copy its contents, and paste into JSON A and JSON B. Or drag the file's contents via your clipboard. (A native file picker is not included in this version, but the editors accept arbitrarily long text.)

Is there a size limit?

No hard limit. The tool will warn you above roughly 2 MB per side, because very large inputs can cause a noticeable pause even in a modern browser.

Can I use this to compare YAML, XML, or CSV?

Not directly β€” this tool is specifically for JSON. To convert YAML, XML, or CSV to JSON first, use the Universal Data Transformer.

What happens if one of the inputs is invalid JSON?

The tool reports the specific error with the line and column, and refuses to run the comparison until both inputs parse successfully. You'll never get a partial or misleading diff.

How is this different from a Git diff on JSON files?

Git's diff is line-based, so it flags every reformatted line as a change. This tool is structural, so it reports only real semantic changes. For machine-generated JSON, the two approaches produce very different output β€” this one is far more useful.

Can I export the diff?

You can copy individual values from the diff list, and you can download the original JSON A or JSON B via the editor's Download button. A dedicated "export diff as JSON" is not included in this version.

Compare two JSON documents now

Paste both inputs, click Compare, and get an instantly readable list of what changed β€” added, removed, or modified, with exact JSON paths.