CraftTools

JSON Diff

Guide: How to Fix the Most Common JSON Errors

2 added · 1 removed · 1 changed

  • Changed$.version"1.0" → "1.1"
  • Added$.tags[2]"tool"
  • Removed$.owner.country"US"
  • Added$.license"MIT"

Nothing you enter or choose here leaves your device. This tool runs in your browser.

A diff by meaning, not by text

A normal text comparison flags every line that was re-indented or reordered. This tool reads both documents as data first, then reports only real differences: values that were added, removed or changed. Reformatting and key order are ignored, and each difference comes with its path.

An example

Left:
{"owner": {"name": "Ada", "team": "core"}, "tags": ["a", "b", "c"], "active": true}

Right:
{"active": true, "owner": {"team": "platform", "name": "Ada"}, "tags": ["a", "c"], "plan": "pro"}
PathChange
$.owner.teamChanged from core to platform
$.tags[1]Changed from b to c
$.tags[2]Removed (c)
$.planAdded (pro)

The key order in the right-hand document is different, and that isn't reported. Neither is the fact that active moved. But look at the tags. By default, lists are compared by position, so removing the middle item shows up as a changed item plus a removed one. That's accurate, though it can look noisy.

Ignoring the order of lists

Tick Ignore the order of items in lists and equal items are matched wherever they sit. For the same tags, the answer becomes a single removal: b is gone. Use this for data where order doesn't carry meaning, such as a set of tags or ids. Leave it off for data where position matters, like steps in a recipe or rows in a ranking.

Reading the paths

  • $ is the top of the document.
  • $.owner.team is the key team inside owner.
  • $.tags[2] is the third item of tags, since counting starts at zero.
  • $["a-b"] is used for keys with unusual characters like a hyphen.

You can paste a path into the JSONPath tester to see the value it points to.

Where it helps

  • Compare an API response before and after a code change.
  • Check what a settings export changed between two versions.
  • Review a data migration: did anything get dropped?
  • Confirm that two services return the same payload, ignoring the order of keys.

If the result is a surprise

  1. Check that both sides are valid JSON. Run each through the JSON formatter first.
  2. Watch for numbers as text. The number 1 and the string "1" are different, and so are 1 and 1.0 in some producers.
  3. Try the list order option, if your change was a reshuffle.
  4. Use Swap to read the differences in the other direction.

Both documents are compared in your browser. For plain text such as prose or code, use the text diff.

Written by Akinrinmade Michael · Updated October 24, 2026

How to use

  1. 1Paste the original JSON on the left and the changed JSON on the right.
  2. 2Tick "Ignore the order of items in lists" if order doesn't matter.
  3. 3Read the list of added, removed and changed values.
  4. 4Use Swap to compare the other way round.

Frequently asked questions

How is this different from a text diff?

It compares the data, not the text. Reformatting, different indentation and a different key order aren't reported as changes, and each difference is shown with its JSONPath.

How are lists compared?

By position by default, so moving an item shows as changes. Turn on "Ignore the order of items in lists" to match equal items wherever they sit.

What do the paths look like?

$.owner.team means the team key inside owner, and $.tags[2] is the third item in tags. Keys with special characters are written like $["a-b"].

Is my JSON uploaded?

No. Both documents are compared in your browser.

Read the guide

Learn how this works and how to get the most from it.

Developer

How to Fix the Most Common JSON Errors

Trailing commas, single quotes, unquoted keys and more. Learn to read a JSON error message and fix invalid JSON quickly.

4 min read

Text Diff Checker

Compare two texts side by side and see exactly what changed.

JSON Formatter & Validator

Prettify, minify and validate JSON, with error line numbers.

JSONPath Tester

Test JSONPath queries against your JSON and see every match.

JSON Schema Generator

Generate a JSON Schema from a sample JSON document.