Skip to content
MtrXTools

JSON diff

Compare two JSON documents and list every added, removed and changed value by its path. Object key order is ignored and array order is kept, so only real differences show. Runs in your browser.

Last updated

What it does

  • Lists every difference between two JSON documents with its path, such as $.env.LOG_LEVEL or $.ports[2], and the old and new values. Hover a path to see its JSON Pointer (/env/LOG_LEVEL).
  • Ignores object key order, so {"a":1,"b":2} and {"b":2,"a":1} are equal. Arrays are compared position by position, because order usually means something in a list.
  • Compares numbers by value: 1, 1.0 and 1e0 are equal, and large IDs such as 12345678901234567891 are compared digit for digit instead of being rounded.
  • Filters the list to added, removed or changed values, and copies a plain-text report you can paste into a ticket or review.

Reading the result

Added means the key or array item exists only in the changed document; removed means it exists only in the original. Changed means the same path holds a different value, including a change of type such as "3" to 3.

An item inserted near the start of an array shifts every later item, so each shows as changed. For lists of records, compare them sorted by a stable key, or diff the records you care about.

Questions

Why does it say "No differences" when the files look different?
Only the data is compared. Spacing, line breaks, key order and the way numbers are written (1.0 against 1) don't change the data, so they don't count.
Can it compare JSON with comments or trailing commas?
No: both inputs must be valid JSON, and an error names the line and column of the first problem. The JSON formatter can repair comments and trailing commas first.
Is my data uploaded?
No. The comparison runs in your browser, so configuration files, API responses and anything else you paste stay on your device.