JSON diff

Compare two JSON objects and get the differences

Paste JSON on both sides and inspect changes — all in your browser

Last updated: February 4, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Introduction / overview

The JSON diff calculator compares two JSON values side-by-side and highlights what changed: added keys, removed keys, and values that were updated. It’s designed for fast debugging, reviews, and “why did this API response change?” moments.

Think in paths: instead of reading the whole document, focus on the exact property path where the value differs (for example user.profile.name).

Who is this for?

  • Developers comparing API responses, configs, feature flags, or webhook payloads.
  • QA and product teams validating that “only this field changed”.
  • Anyone reviewing a JSON snippet in a ticket, PR, or incident channel.

Privacy note: the comparison runs locally in your browser. Your JSON is not uploaded to a server.

If you’re cleaning up data before diffing, it can help to first convert formats using JSON to YAML converter (for readability) or validate URLs inside the payload with URL parser.

How to use / quick start

  1. 1Paste your “before” JSON on the left and your “after” JSON on the right. If you’re diffing an API response, keep the raw shape (don’t hand-edit keys unless you intend to).
  2. 2Enable Only show differences to hide unchanged branches. This is the fastest way to get a short list of “what changed”.
  3. 3Click any value in the diff results to copy it. This is handy when you want to paste the exact value into a test, a config file, or a bug report.
  4. 4Use Share to generate a link that preserves inputs. It’s a clean way to sync up with a teammate without re-pasting large payloads.

Example 1: count the changed fields

Imagine you’re comparing two small payloads and you notice three changed paths. You can summarize the “size” of the change with a simple count:

ndiffn_{diff}==33

If the object has nkeys=20n_{keys}=20 top-level and nested keys you care about, you can also compute a rough change rate:

rr==ndiffnkeys100%\frac{n_{diff}}{n_{keys}}\cdot 100\%==320100%\frac{3}{20}\cdot 100\%==15%15\%

That’s a quick way to say: “About 15%15\% of what we care about changed.” It’s not perfect, but it’s a great conversation starter.

Example 2: spot a version bump

If a single field changes from 11 to 22, you can describe it as a delta:

Δv\Delta v==vnewvoldv_{new} - v_{old}==212 - 1==11

In practice this means: a version bump happened — so you might need to update a client schema, a test snapshot, or a downstream mapping.

Real-World Examples / Use Cases

Compare two API responses after a deploy

Background: A frontend suddenly breaks after a backend change, but both responses “look” fine at a glance.

Inputs: old response JSON vs new response JSON.

Result: the diff highlights the exact field that changed type (for example a string becoming an object) so you can fix the parsing code.

Helpful pairing: if the payload contains JWTs, use JWT parser to inspect claims.

Validate that a config change is “only this one knob”

Background: A config file (feature flags, environment settings) changed, and you want a quick safety check.

Inputs: previous config JSON and the proposed config JSON.

Result: you can confirm exactly which keys were added/removed before merging.

Spot shape changes in stored documents

Background: A database document from production doesn’t match what your code expects.

Inputs: a “known-good” sample document and a problematic one.

How to apply: the diff tells you whether it’s a missing field (added/removed) or a semantic change (updated).

Debug flaky tests with snapshot JSON

Background: A snapshot test fails occasionally with huge JSON output.

Inputs: the previous snapshot JSON and the failing snapshot JSON.

Result: you can see whether the change is just ordering/formatting or a real value drift (timestamps, counters).

Common scenarios / when to use

Payload validation

Confirm if a partner changed a field name, type, or nesting level.

Bug reports

Share a minimal diff with teammates instead of pasting a huge JSON blob in chat.

Release reviews

Compare “before vs after” sample outputs to ensure the change is intentional.

Feature flags

Verify only the intended flag was toggled across environments.

Security-sensitive diffs

Spot newly exposed fields (tokens, secrets) before logs or clients pick them up.

Migration sanity checks

Compare documents before and after a migration script to ensure shape compatibility.

When it may not be the right tool: if you need to generate a machine-applied patch (like JSON Patch) or a semantic merge, a visual diff is only the first step. JSON diff is best for human inspection.

Tips & best practices

Start with “only show differences”

If the JSON is large, hide unchanged branches first. Then expand only the parts you care about.

Click-to-copy values for faster debugging

Copy exact values into tests, API calls, or documentation instead of retyping.

Normalize data when comparing outputs

If a payload includes timestamps or random IDs, consider removing those fields before diffing so you can focus on stable changes.

Use related tools for a smoother workflow

Convert JSON for readability with JSON to YAML converter, and validate embedded URLs with URL parser.

Calculation method / formula explanation

Under the hood, the tool compares values recursively. At each path, it decides whether a key was added, removed, updated, unchanged, or “children-updated” (meaning the container exists on both sides, but something inside differs).

P={pA[p]B[p]}P = \{p\mid A[p] \neq B[p]\}

where pp is a property path and AA, BB are the left and right JSON values.

Key idea: compare by type first

  • If type(A[p])type(B[p])\mathrm{type}(A[p]) \neq \mathrm{type}(B[p]), it’s an update.
  • If both are objects/arrays, recurse into children and mark the parent as “children-updated” when any child differs.
  • If both are primitives, compare values directly and mark unchanged vs updated.

Turn diffs into a simple metric

If you treat P|P| as “how many things changed”, you can compute a quick percentage over some baseline nn:

rr==Pn100%\frac{|P|}{n}\cdot 100\%

This can be useful when you’re reviewing a change and want a quick “small vs large” signal.

Related concepts / background info

JSON vs JSON5

Many tools accept JSON5-style input (like trailing commas) because it’s friendlier for humans. If your payload must be strict JSON for an API, validate it against the standard before shipping.

Objects vs arrays

Arrays are order-sensitive: a reorder can look like a lot of changes. Objects are key-based: key order usually does not matter, but missing keys do.

If your JSON includes encoded URLs or query strings, parse them first using URL parser. It’s often easier to debug differences in decoded form.

Frequently asked questions (FAQs)

Why does a small reorder look like a huge diff?

Arrays are order-sensitive. If two arrays contain the same items in a different order, the diff will show many “updated” entries even though the set of items is similar.

Can I diff JSON that contains comments or trailing commas?

Often yes, if it’s valid JSON5-style input. For strict API payloads, prefer standard JSON.

What does “children-updated” mean?

It means the parent is an object/array on both sides, but at least one nested child differs. The parent itself didn’t change type — something inside changed.

How do I share the comparison with a teammate?

Use the Share button under the calculator. The shared URL can include the left and right inputs, plus whether d=1d=1 (“only differences”) is enabled.

Is the diff a patch I can apply automatically?

No — it’s a visual comparison for humans. If you need an applyable patch, you’ll want a JSON Patch or a merge tool.

What’s a good next step after I find the changed field?

Update the consumer (schema, mapping, tests) and then re-run the diff on a fresh sample to confirm the fix eliminated the unexpected change.

Limitations / disclaimers

This tool highlights structural differences, but it does not tell you whether a change is “good” or “bad”. Always interpret diffs in the context of your schema and business rules.

Avoid sharing sensitive data. Even if the comparison runs locally, a shared link can include the JSON in the URL.

External references / sources

JSON diff | CalculatorVast