Skip to content

Free JSON Diff & Compare

Compare JSON structure with ignored properties, numeric tolerance and unordered-array options.

✓ Free to use✓ No sign-up✓ Browser-based

Loading tool…

How to compare JSON by structure instead of formatting

Formatting changes can hide the important differences between two JSON documents. Structural comparison ignores object key order and reports changes to values and array contents.

  1. Paste or import the original JSON document.
  2. Provide the second document and choose any ignored property names.
  3. Set numeric tolerance or unordered-array comparison when those options match your task.
  4. Run the comparison and inspect each JSON Pointer before downloading the findings.

When a structural JSON comparison saves time

A plain text diff struggles with JSON. If one file was saved with two-space indentation and the other was minified, every line looks different even when the data is identical. This comparer parses both documents first and compares the actual values, so only real data changes appear in the report.

Typical uses include checking an API response before and after a deployment, reviewing a configuration file that a teammate edited, confirming that a data export matches last week's export, and verifying test fixtures. QA testers often compare an expected response with an actual one, and the ignore list lets them skip fields such as timestamps or request IDs that change on every call.

Worked example: one price change

Load the built-in example. The first document lists two books with prices 12 and 18. The second is identical except that the first book costs 15. Run Compare JSON with no options and the report reads: equal is false, and the changes list holds one entry with path /store/books/0/price, kind changed, before 12 and after 15.

Now set the absolute numeric tolerance to 3 and compare again. The difference is |15 - 12| = 3, which is not greater than the tolerance, so the report shows equal as true with an empty changes list. Set the tolerance back to 0 and type price in the ignore box instead. The result is also equal, because every property named price is skipped at any depth.

The report is a JSON file you can copy or download. It also records the options you used, so a reviewer can see why a field was not flagged.

How the comparison works

Objects are matched by property name, so key order never matters. A property that exists only in the first document is reported as removed, and one that exists only in the second is reported as added. When both sides hold a value but they differ, including a type change such as the string "12" versus the number 12, the entry is marked changed with both values shown.

Locations use JSON Pointer syntax from RFC 6901. Each step is separated by a slash, array positions are zero-based numbers, and a slash inside a key name is written as ~1 while a tilde is written as ~0. Arrays are compared position by position unless you tick the unordered option, which sorts both arrays by their serialized content before comparing.

Each document can be up to 2 MB, with up to 80,000 nodes and 60 levels of nesting. The comparison stops after 5,000 differences, which is usually a sign that the documents are unrelated or that a noisy field should be ignored.

Common mistakes to avoid

Do not use the unordered option for lists where position carries meaning, such as ranked results or ordered steps. In unordered mode a single edited item can move to a new sorted position, so you may see several neighboring indexes flagged instead of one clean change.

Be precise with tolerance. It is an absolute amount applied to every number in the document, so a tolerance of 0.5 meant for prices will also hide a quantity that moved from 1 to 1.4. Finally, remember that ignored names apply everywhere: ignoring id at the top level also ignores every nested id.

Useful tips and limitations

  • Unordered array indexes refer to sorted comparison order. Duplicate values are retained.
  • Ignore fields carefully: an ignored property can conceal a meaningful change.
  • Compare a small sample of each file first to choose a sensible ignore list before running the full documents.
  • Keep the downloaded report with your ticket or pull request so others can see exactly which pointers changed.

Common questions

Does JSON comparison ignore object key order?

Yes. Object properties are compared by name, so indentation and key ordering do not create differences.

Can I apply the downloaded comparison as a JSON Patch?

No. The export contains findings and comparison options, rather than executable patch operations.

How is a missing property different from a null value?

A property that does not exist on one side is reported as added or removed, while a property set to null on one side and a value on the other is reported as changed.

Is the numeric tolerance a percentage?

No. It is an absolute difference, so a tolerance of 0.01 allows any two numbers that differ by 0.01 or less to count as equal.

Can I ignore a nested path instead of a property name?

No. The ignore box takes comma-separated property names, and each name is skipped wherever it appears in either document.

Both JSON documents are compared locally in a browser worker.

Read our privacy policy · About ToolWorld Online