Skip to content
Browser tool Runs locally

JSON Diff / Compare

Compare two JSON documents and see exactly what changed. Runs locally in your browser.

JSON A · Original / before
0 chars
JSON B · Modified / after
0 chars
Comparison result
Paste JSON in both panels and click Compare JSON.

Parsed-data tools accept up to 1 million characters, 128 nesting levels and 20,000 values or containers. Integers must stay within ±9007199254740991; decimals that would change value and negative zero are refused. Quote exact identifiers or numbers outside these limits. The JSON Formatter and Minifier preserve original number tokens.

What is JSON diff?

JSON diff compares two JSON documents structurally - value by value, key by key - and reports what was added, removed, or changed between them. Unlike a plain text diff, it understands JSON's structure, so it isn't thrown off by reordered keys or different indentation.

How to compare two JSON documents

  1. Paste the original in JSON A.
  2. Paste the modified in JSON B.
  3. Click Compare JSON.
  4. Review the result.

Try a change you can verify

Compare {"status":"queued","items":[1,2]} with {"items":[1,3],"status":"ready"}. The status value and array index 1 change; moving the items key does not count as a change. A number and a quoted number are different types, so {"count":5} and {"count":"5"} differ.

Exact numbers and supported limits

Parsed comparisons accept integers from −9007199254740991 to 9007199254740991. Numbers whose decimal value would change during parsing, including negative zero, are refused. For example, an unquoted identifier 9007199254740993 produces an unsupported-number error; it must never be reported equal to 9007199254740992. If the field is an identifier, quote both original values to compare them exactly. Do not change numeric data to strings without checking your data contract. The token-based JSON Formatter and Minifier can retain large numeric tokens without parsing their values.

Common mistakes and edge cases

  • Expecting an array diff to align items by value rather than position - inserting an item shifts every later index, which shows up as a cascade of changes rather than a single insertion.
  • Treating absent, null and empty-string fields as equivalent: an absent key is a removal or addition, while null and an empty string are different values.
  • Pasting invalid JSON into either field - both documents must parse successfully before they can be compared, so fix any syntax errors first (a JSON validator can help pinpoint them).

Frequently asked questions

Does the comparison care about formatting or key order?
No. The comparison is structural, not textual - it parses both documents and compares their actual values. Whitespace, indentation, and the order of keys within an object don't affect the result, since JSON objects are unordered by definition.
How are arrays compared?
Arrays are compared by index - the item at position 0 in JSON A is compared to the item at position 0 in JSON B, and so on. This means inserting or removing an item in the middle of an array will show every item after it as changed, since their positions shifted, even if the values themselves didn't.
Is my JSON uploaded to a server?
The comparison processes inputs locally in your browser. Website, analytics and advertising requests are separate; see the Privacy policy. Avoid using real credentials in examples or sharing confidential output.
Can I compare very large JSON files?
Each input is limited to 1,000,000 characters, 128 container levels and 20,000 values and containers. Split larger documents into relevant sections. Unsupported numeric values stop comparison rather than producing rounded output.
Does the diff detect type changes, like a number becoming a string?
Yes. If a value's type changes - for example "count": 5 becomes "count": "5" - that's reported as a change even though the values might look similar, because JSON treats them as distinct types.

Related tools