A diff that reads the JSON, not just the text
Two JSON files can hold exactly the same data and still look different: keys in another order, another indentation, a number written 1.0 instead of 1. A line-by-line diff then flags dozens of changes that are not real. This tool does the opposite. It parses both documents and walks through them key by key and item by item, so it only reports what actually changed, each time with the exact path, such as $.users[2].email.
Typical uses: checking that an API response did not change after a release, comparing the staging config file with the production one, or reviewing an export before importing it somewhere else.
How to use it
- Paste the first document into "JSON A (original)" and the second into "JSON B (changed)", or use "Open a file". Each box is validated: if something is wrong, the message gives the line, the column and the cause, and "Go to the error" puts the cursor on it.
- The comparison runs on its own. The counters show how many values were added, removed and changed, and how many type changes there are.
- Pick a view: "List of differences", "Side by side" (the A and B trees aligned) or "JSON Patch".
- Adjust the options if needed, then use "Copy the report", "Report .txt" or "JSON Patch .json".
"Format A and B" and "Sort keys" rewrite both texts with a 2-space indent. "Swap A and B" reverses the direction of the comparison.
Worked example and symbols
With A = {"a":1,"b":[1,2],"c":{"d":"x"}} and B = {"a":2,"b":[2,1],"c":{"d":"x","e":true}}, the tool finds 4 differences:
| Symbol | Path | Detail |
|---|---|---|
| ~ | $.a | 1 → 2 |
| − | $.b[0] | 1 removed |
| + | $.b[1] | 1 added |
| + | $.c.e | true added |
The array [1,2] turned into [2,1] is read as the 1 moving to the end. If order does not matter to you, tick "Ignore the order of array items": only 2 differences remain, $.a and $.c.e. The +, − and ~ symbols work without colors, on screen and in the text report.
Matching items by an identifier
For a reordered list of objects, choose "by identifier key" and type id. With A = [{"id":1,"v":"x"},{"id":2,"v":"y"}] and B = [{"id":2,"v":"y2"},{"id":1,"v":"x2"}], the tool reports 2 changes ($[0].v: "y" → "y2" and $[1].v: "x" → "x2") instead of 4 when objects are paired by position.
What a JSON Patch is
JSON Patch is a standard format that describes changes as a list of operations: add, remove and replace, each with a path such as /c/e. For the example above, the 4 operations applied to A in order give back B. A program can send just these changes instead of the whole document.
Other options
"Ignore case in strings" makes "Boston" equal to "BOSTON". "Numeric tolerance" set to 0.01 treats 1 and 1.004 as equal. "Ignored paths" leaves out values that change on every call, such as $.meta.updatedAt or $.users[*].lastLogin. Files of several megabytes are compared in the background, so the page stays responsive.
FAQ
How is this different from a text diff?
A text diff compares lines. Here only the data counts: key order, spaces and line breaks have no effect, and every difference comes with its path.
What is a type change?
A value that changes kind, for example the number 8080 becoming the string "8080". This kind of change often breaks code while being hard to spot by eye.
Is my JSON uploaded anywhere?
No. Everything is computed in your browser. Only your options are remembered for your next visit, never the content of the boxes.
Does the JSON Patch follow the options?
Yes, it only holds the differences shown. With no option set, it turns A into B exactly. If array order is ignored, new items are appended at the end of the array.