Text utilities

JSON Compare

Compare two JSON documents structurally and list changed, added or removed values by pointer.

Text stays in your browserCopy your result
Data workspace
Data workspace

Check delimiters and structure before downloading the output.

See the method

Your source data

Runs on your device

Your transformed data

Your result

Let’s calculate.

Use the Calculate button to see your result.

Your content is processed locally.

How to use this tool

  1. Enter original json, updated json.
  2. Select Update result to view the result.
  3. Check the method and assumptions below before using the result.

Input reference and sample values

Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.

InputFormat and unitsSample
Original JSONKeep the structure and separators shown in the sample. Line breaks are retained in this input.{"name":"Sam","active":false,"roles":["reader"]}
Updated JSONKeep the structure and separators shown in the sample. Line breaks are retained in this input.{"name":"Sam","active":true,"roles":["reader","editor"]}

Result for these sample inputs

[
  {
    "path": "/active",
    "change": "changed",
    "before": false,
    "after": true
  },
  {
    "path": "/roles/1",
    "change": "added",
    "after": "editor"
  }
]
Differences
2

Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.

The method, explained

Parse both documents, ignore object-property ordering, and recursively compare values. Array order remains significant. Change locations use JSON Pointer escaping.

A WORKED EXAMPLE

Using original json = {"name":"Sam","active":false,"roles":["reader"]}, updated json = {"name":"Sam","active":true,"roles":["reader","editor"]}, the result is [ { "path": "/active", "change": "changed", "before": false, "after": true }, { "path": "/roles/1", "change": "added", "after": "editor" } ]. Change these example inputs to match your task; use the method above to check each step.

What to keep in mind

Array insertions can produce multiple positional changes. Inputs are limited to 20,000 characters; very deep JSON is rejected.

Common questions

Is whitespace a difference?

No. Whitespace and object-key ordering do not affect this comparison. Different types do: the number 1 differs from the string "1".

Is array order ignored?

No. Arrays are ordered sequences, so moving an item can change several index positions.

Methodology maintained by ClarityKit. How these tools are built and checked.