{}JSONLint.app

Paste two JSON documents below to see exactly what's different:

Loading...
Loading...

When to Use JSON Diff

JSON Diff compares two JSON documents and highlights every difference—additions, deletions, and changes. It's essential when you need to:

  • Debug API responses — Compare what your API returned yesterday vs. today to find unexpected changes
  • Review configuration changes — Before deploying a config update, see exactly what's different
  • Validate data transformations — Confirm your ETL pipeline produces the expected output
  • Code review JSON fixtures — Quickly spot what changed in test data files

Understanding the Output

The diff view uses standard conventions:

  • + Green lines — Added in the second document
  • - Red lines — Removed from the first document
  • Gray lines — Unchanged context

Example: Comparing API Responses

Say you're debugging why a user's profile looks different. Compare the two responses:

Yesterday's response:

{
  "id": 123,
  "name": "Alice",
  "role": "admin",
  "active": true
}

Today's response:

{
  "id": 123,
  "name": "Alice",
  "role": "viewer",
  "active": true,
  "lastLogin": "2024-01-15"
}

The diff immediately shows: role changed from "admin" to "viewer", and lastLogin was added.

Pro Tips

  • 💡 Order doesn't matter — JSON objects are unordered by spec.{"a":1,"b":2} equals {"b":2,"a":1}. Our diff normalizes this.
  • 💡 Format first — For cleaner diffs, paste minified JSON and let us format it. This ensures consistent indentation.
  • 💡 Use the Swap button — Quickly reverse the comparison direction if you pasted in the wrong order.

Common Questions

Why do two identical-looking objects show as different?

Usually it's whitespace or key ordering. Try clicking "Format" on both sides first. If they still differ, look for subtle type differences like "1" (string) vs 1 (number).

Can I compare JSON from URLs?

Not directly in this tool, but you can use the JSON Validator with the ?url= parameter to fetch JSON, then copy it here.

Is there a size limit?

The diff runs entirely in your browser. Files up to a few MB work fine; very large files (10MB+) may slow down the comparison.

Related Tools

Common Mistakes & Pro Tips

  • Key order does not matter for objectsJSON object members are unordered, so two objects with the same keys and values are equal regardless of key order. A good diff ignores reordering of keys and only reports genuine additions, removals, or value changes. Do not treat reordered keys as a difference.
  • Arrays are usually compared by indexMost structural diffs align array elements by position, so inserting one item at the front can make every later element look changed. If your arrays are really sets or keyed lists, sort them or compare by an identity field before diffing to avoid noisy, misleading results.
  • Type changes are real changesA value going from the number 1 to the string "1", or from null to 0, is reported as a change because JSON types differ. Watch for these when one side was serialized differently (for example numbers stringified by an API).
  • Added vs changed vs removedA key present only on the right is an addition, present only on the left is a removal, and present on both with different values is a change. Distinguishing these helps you read the diff: a removal plus an addition at the same path often means a value or type change, not two unrelated edits.
  • Whitespace and formatting are irrelevantThe diff compares parsed JSON values, not raw text, so indentation, trailing newlines, and spacing never show up as differences. Use a text diff tool if you specifically care about formatting; use this tool to compare data.

Frequently Asked Questions

Does this compare the text or the data?

It compares the parsed JSON structures, not the raw characters. That means formatting, indentation, and key order are ignored, and only meaningful differences in keys and values are reported. To compare exact text including whitespace, use a plain text diff instead.

Why does changing one array item flag many differences?

Arrays are compared by index, so inserting or deleting an element shifts every subsequent item and each shifted position is reported as changed. If your array represents an unordered set or records keyed by an id, sort both sides consistently or match by that key before comparing to get a clean diff.

How do I tell apart added, removed, and changed entries?

The diff labels each result by where the value exists: only on the second document means added, only on the first means removed, and present in both with differing values means changed. Each result includes the path to the location so you can navigate straight to it in your data.

Is 1 equal to 1.0 in the comparison?

Numerically they are the same value, since JSON has a single number type, so a well-behaved structural diff treats 1 and 1.0 as equal. However, the number 1 and the string "1" are different types and will be reported as a change. Be mindful of APIs that serialize numbers as strings.

What format are the difference paths in?

Differences are reported as paths from the document root through keys and array indices to the changed location, such as store.book[0].price. You can use that path to find the value in the original JSON or to feed a query tool. Object keys with special characters may be shown in bracket notation.

Are both documents kept private?

Yes. Both JSON inputs are parsed and compared entirely in your browser, and neither is uploaded. This lets you safely diff sensitive configurations or API responses, for example comparing a staging payload against production.