JSON Compare

Compare JSON objects by structure, ignoring object key order while preserving array positions.

Processing happens in this browser. Your inputs and files are not uploaded.

Each input: at most 200,000 characters. Combined: 50,000 values and 100 nesting levels. Duplicate JSON keys keep their last value; large numbers may lose precision.

Compare values rather than formatting

Two API responses can contain the same data even when their property order and indentation differ. JSON Compare parses both inputs, then reports structural differences. Object key order is ignored. Array order remains significant: swapping two entries produces changes at their positions rather than a move operation.

How to compare two JSON documents

  1. Paste the earlier document into Input text and the newer document into Second JSON value.
  2. Choose Compare JSON.
  3. Read the match summary or the difference count. The table shows each changed path, its change type and before/after values.
  4. Expand View full JSON report for the complete data, or choose Download JSON report to save it.

Load example (replaces inputs) fills both fields. The first example contains a reader role; the second adds an editor role. The result contains an added change at /roles/1. Editing either input clears the previous report so it cannot be mistaken for a comparison of the new values.

Understand the difference report

Paths use JSON Pointer notation: array positions start at zero, / inside a property name becomes ~1, and ~ becomes ~0. An empty path identifies a change to the entire document. Each change is added, removed or changed, with the applicable before and after values. The report is a description, not an executable JSON Patch. The visible table shows the first 200 differences and shortens long values to 300 characters; the expandable and downloaded report retain the full results.

For example, comparing {"count":1} with {"count":"1"} reports a change because a number and a string are different types. Comparing {"a":1,"b":2} with {"b":2,"a":1} returns equal: true.

Limits and cases to check

Each input is limited to 200,000 characters. Together they may contain at most 50,000 values and 100 nesting levels. Invalid JSON, comments and trailing commas are rejected. Duplicate property names follow the browser JSON parser: only the final value survives. Very large numeric identifiers can lose precision during parsing; represent identifiers as strings if exact digits matter. Non-finite numeric results are rejected.

This is not a schema validator or a semantic comparison of dates, units or unordered collections. If whitespace, duplicate keys or original number spelling matter, compare the original documents with Text Compare. Use JSON Formatter to inspect readable JSON before comparing it.

Why does an inserted array item change later positions?

Arrays are compared by index, not by an inferred ID. Adding an item at the beginning shifts later values. For records with stable IDs, normalize the data into an object keyed by those IDs before comparing.