JSON Compare

Compare two JSON documents by their values and structure. Object-key order is ignored; array positions remain significant.

Text is processed locally in your browser and is not uploaded.

Structural differences
1
Differences shown
1

How to use this tool

  1. Paste valid JSON into First JSON document and Second JSON document. Either input can be an object, array, or primitive value.
  2. Select Compare JSON values to inspect structural equality and changed paths.
  3. Review additions, removals, and replacements. The report shows at most 100 differences while counting the complete comparison within the input limits.

Understanding the output

Equal values produce an equality message even when indentation or object-key order differs. Changes are shown at JSON Pointer paths: an empty quoted path means the root, and /items/0 means the first item in the items array. Replacing an entire container with another type counts as one structural difference; the report is an inspection summary, not an executable JSON Patch.

One changed boolean

Comparing {"name":"Ada","active":true} with {"active":false,"name":"Ada"} produces one structural difference at /active: true → false. Reordering name and active alone would produce an equality result.

Choose structural comparison for data changes

A text diff can be useful when reviewing formatting, but indentation and property order often obscure the actual change in a JSON response. This comparison parses the documents before comparing values. The number 1 and the number 1.0 are therefore equal, while the string "1" and the number 1 are different types. Missing properties also differ from properties explicitly set to null.

Arrays are compared by position, not by an inferred record identifier. Inserting an item at the beginning can change many positions. If your data represents an unordered set, sort or align it deliberately in your application before comparing; this tool does not guess how records correspond.

Read paths before applying changes

JSON Pointer escapes a slash inside a property name as ~1 and a tilde as ~0. These escapes distinguish an actual key containing punctuation from nested objects. String previews are shortened after 100 characters, paths after 1,000 characters, and containers are summarized by size when replaced or added. Consult the original inputs for full values before editing important configuration.

Method and supported input

Native JSON parsing reads both values. Iterative validation rejects nonfinite numbers and integers outside the safe integer range. Comparison checks own properties, ignores object-key order, and compares array indices. Each document is limited to 20,000 values and 100 nesting levels. Up to 100 difference lines are emitted.

  • Native JavaScript precision for fractional numbers and last-value handling of duplicate object keys are acceptable for the comparison.

Limitations

  • This is not JSON Schema validation, a text diff, an array alignment algorithm, or a JSON Patch generator.
  • Duplicate keys, numeric spelling, and very fine fractional differences may lose distinctions during parsing. Integers outside the safe integer range are rejected; use quoted strings for exact long identifiers.

Common questions

Does property order affect equality?

No. Objects with the same own property names and equal values compare equally regardless of key order. Array order still matters.

Is a missing property the same as null?

No. The comparison reports an addition or removal when one document lacks a key, even if the other explicitly stores null.

Why can moving an array item create several differences?

The tool compares each array index directly. It does not identify moved records or calculate a minimum-edit sequence.

Sources and further reading