±

JSON Diff – Compare Two JSON Objects Online

Compare JSON structure and values without whitespace or object-key-order noise.

Runs locallyNo accountFree
Original JSONMaximum 1 MB
Changed JSONMaximum 1 MB
Differences and JSON PatchRead only

Ready. Input is processed only in this tab.

Important

Objects are compared without considering key order. Arrays are compared by position, so inserted or reordered items can appear as multiple changes. Inputs and results stay in this browser tab.

How to use this json diff

  1. Paste the original and changed JSON documents.
  2. Select Compare JSON to run a structure-aware comparison.
  3. Review path-level differences and copy the RFC 6902 JSON Patch.

Compare JSON by structure, not by lines

A text diff treats indentation, line endings and property order as changes. This comparator parses both inputs first and then compares their JSON values. Two objects with the same key-value pairs are therefore equal even if one is minified and the other is formatted, or if their keys appear in a different order. Use it for API response checks, configuration reviews, test fixtures and data-transformation debugging where the actual structure matters more than the source layout.

How differences are reported

Every difference is labelled as added, removed or changed and tied to a JSON Pointer path. A path such as /user/role identifies the role property inside the user object. Property names containing a slash or tilde are escaped according to RFC 6901, so the path remains unambiguous. The output also shows the old and new values where they exist, followed by a machine-readable JSON Patch document.

Object order versus array order

JSON objects are unordered collections of named properties, so changing object-key order creates no semantic difference. Arrays are ordered sequences and are compared by numeric position. If an item is inserted near the beginning, later items may appear changed because their indexes shifted. The comparator does not guess stable IDs, detect moves or treat an array as a set. That explicit position rule prevents a convenient-looking guess from hiding a real ordering change.

RFC 6902 JSON Patch output

The generated patch uses add, remove and replace operations described by RFC 6902. Operations are ordered so trailing array removals occur from the highest index downward. The patch represents this comparator’s position-based result; review it and test it against a copy before applying it to production data. This page does not execute the patch or modify either input.

Validation and privacy boundaries

Both sides must be strict JSON: object keys and strings need double quotes, and comments or trailing commas are rejected. Each input is limited to one million characters and comparisons stop when more than 10,000 differences would be produced, protecting browser responsiveness. Parsing, comparison and patch generation happen in the current browser tab. No pasted document is submitted to Code Compass, though a compromised or shared device can still expose sensitive values.

Choose the next JSON tool

Use the JSON Formatter to correct syntax or inspect one document, the JSON and CSV Converter for table-shaped data, or the URL Parser when the JSON value came from an encoded query parameter.

Frequently asked questions

Does object key order affect the comparison?

No. Parsed objects are compared by property name and value, not source order or whitespace.

How are arrays compared?

Each array value is compared at its numeric index. Reordering can therefore create several reported differences.

Can I apply the generated patch automatically?

The output follows the add, remove and replace structure of RFC 6902, but you should review and test it before using it to update important data.

Related developer tools