Skip to content

JSON Diff – Compare Two JSON Documents

Paste two JSON documents and see what changed in the data, regardless of key order or indentation.

Processed locally in your browser

What is JSON Diff – Compare Two JSON Documents?

Two JSON files can be equal in meaning and still look completely different as text: keys in another order, minified versus pretty-printed, different indentation. This tool parses both sides, rewrites them with recursively sorted keys and a 2-space indent, and then compares them line by line.

Added, removed and changed properties and array items are highlighted with colour and + / − markers, in an inline or side-by-side view. If either side is not valid JSON, the tool tells you which one and where the parser stopped. You can copy the result as a unified diff.

How does it work?

  1. Paste the original JSON on the left and the modified JSON on the right.
  2. If a side is invalid, fix the error reported under that box (the message names the side).
  3. Read the highlighted lines: red with − were removed or changed, green with + were added or changed.
  4. Choose inline or side-by-side view, copy the unified diff, or swap the sides to reverse the comparison.

Common use cases

  • Comparing two API responses to see what changed between environments or releases.
  • Reviewing configuration or package manifests where key order is not significant.
  • Checking that a data migration or serializer change kept the same content.
  • Spotting the one field that differs between a working and a failing payload.

Examples

Try this input in the tool above:

{"name":"Ada","role":"admin","tags":["a","b"],"active":true}

Privacy

JSON Diff – Compare Two JSON Documents runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Object key order is ignored, but array order is meaningful and is kept. Numbers are parsed as JavaScript numbers, so integers beyond 2^53 or extra precision may be normalised. Comments and trailing commas are not valid JSON.

Frequently asked questions

Does key order matter?

No. Keys are sorted before comparing, so {"a":1,"b":2} and {"b":2,"a":1} are identical. Array item order still counts.

Why do I see a different line count from my file?

The tool re-prints both documents in a canonical form (2-space indent, one property per line). That is what makes formatting differences disappear.

Can I compare very large JSON files?

Inputs are compared by lines and can be several megabytes; above 2 million characters in total the comparison is refused to keep your browser responsive.

More tools in JSON & Data →