JSON Compare

Compare JSON structures live, swap documents and choose a report limit while retaining complete difference counts.

Up to 1 MB and 100,000 characters. You can also paste or edit text below.
Up to 1 MB and 100,000 characters. You can also paste or edit text below.
Whole number from 1 to 1,000. The total still counts all differences.

Files and text are processed locally in your browser and are not uploaded.

Structural differences
1
Differences shown
1
Page guide

How to use this tool

  1. Upload or paste the two JSON documents; each file stays in its own editable input.
  2. Set Maximum differences to show from 1 to 1,000, or keep the default 100. Swap documents to reverse additions and removals.
  3. Valid input updates after a brief typing pause. You can also use the main action button. Resolve errors before copying or downloading.
  4. Clear input keeps the conversion settings; Undo input change restores the previous inputs after clear or reverse. Reset restores the example and default settings.

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. Comparing {"a":1,"b":2} with {} and a report limit of 1 gives two structural differences and one displayed difference.

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. The default is 100 difference lines; the configurable maximum is 1,000.

Files are read locally as UTF-8, or UTF-16 with a byte-order marker, without uploading either document. The comparison can be downloaded as a UTF-8 text report.

The report limit affects displayed rows only. Complete difference totals remain available, with bounded previews and paths. Arrays are still compared by index.

  • 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.
  • Each file is limited to 1 MB and 100,000 characters. Files must contain JSON text; binary and compressed formats are not supported.

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.

Can I compare two JSON files?

Yes. Each document has its own file chooser. Files load into separate text inputs, so you can also compare a file with pasted JSON and edit either side.

Sources and further reading

Reviewed on