Category: Developer tools

JSON Diff

System ideaMissing a tool?

Paste two documents and see which values actually changed

Paste two JSON documents and get added, removed and changed rows with paths like a.b[2].c. Key order and indentation are ignored, and nothing leaves your browser.

Differences: 3
- version: 3
+ version: 4
Changed — version
- tags[0]: "draft"
+ tags[0]: "final"
Changed — tags[0]
+ paid: true
Added — paid

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

The reason a json diff exists at all is that a text diff lies about JSON. Reorder two keys, reindent a block, minify one side, and a line-based tool paints the whole file red even though the data is identical. This tool parses both documents with the browser's own JSON parser first and compares the resulting structures, so key order and whitespace simply do not enter into it. Two text areas arrive prefilled with a short sample pair; replace them with your own payloads and the comparison reruns on every keystroke, with no compare button to press. Objects and arrays are walked recursively and every difference gets a path in dot-and-bracket notation such as a.b[2].c, with $ used when the difference is at the root. Each one is classified: added when the key or index exists only on the right, removed when it exists only on the left, changed when both sides have it with different values. Arrays are compared position by position up to the length of the longer side, and the extra positions come back as added or removed. Above the list sits the total number of differences; below it, one row per difference carrying the path, a removed line and an added line, each value previewed as JSON text and cut at 120 characters with an ellipsis so a single large object cannot swallow the page. Values that serialise to the same JSON text count as equal, so negative zero and zero do not produce a row. When the documents match structurally the tool says so outright, and when either side fails to parse it names which side and passes through the parser's own message, which is usually enough to find the stray comma. The boundaries are worth knowing before you reach for it. Pasted text is the only input — no file upload, drag-and-drop, URL fetch or folder comparison. The parser accepts strict JSON only, so JSON5, JSONC, comments, trailing commas, single-quoted strings, NDJSON and YAML are rejected. Arrays are matched by position only: insert one element at the front and every later position is reported as changed, because there is no id-based matching and no move detection. There is no machine-readable output — no RFC 6902 JSON Patch, no JSON Merge Patch, no unified diff — and no merge, apply, accept-left, accept-right or three-way comparison against a common ancestor. There is no aligned side-by-side view, syntax highlighting, collapsible tree or line numbers; no ignore list, key filter, path exclusion, case-insensitive mode or numeric tolerance; no schema validation and no formatting or prettifying of either input; no comparing more than two documents at once; and no copy button, saved comparison, permalink or download. Both documents are parsed and compared in the browser — which matters, because API payloads and config files routinely carry keys, tokens and customer data — and nothing is uploaded or remembered between visits.

How to use it

  1. Paste one document into each field, replacing the sample pair; the comparison reruns as you type, with no compare button.
  2. Read the difference count and the rows beneath it: each carries a path such as a.b[2].c, or $ at the root, and an added, removed or changed label.
  3. If a side does not parse, the message names which side failed and passes through the browser parser's own error.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

What is a JSON diff?
It is a comparison that parses both documents first and reports differences between values, rather than comparing the two files line by line. That distinction — often called a semantic or structural diff — is why reordering keys or reformatting one side produces no differences here at all.
How do I compare two JSON files online?
Paste the contents into the two fields, replacing the sample pair, and the result updates as you type. Note that pasted text is the only input: there is no file picker, drag-and-drop, URL fetch or folder comparison, so a .json file has to be opened and copied first.
Does key order or indentation matter when comparing JSON?
No. Objects are compared as data, so the same keys in a different order are identical, and indentation, line breaks and minification are irrelevant once both sides have parsed. Arrays are the exception, because order is meaningful in an array.
Why does inserting one array item mark everything after it as changed?
Because arrays are compared position by position. Index 0 is compared with index 0, index 1 with index 1, and so on to the length of the longer side, so an insertion at the front shifts every later element into a new slot. There is no id-based matching and no move detection to absorb that shift.
Is my JSON stored or sent to a server?
No. Both documents are parsed and compared in the browser, and nothing is uploaded or kept between visits. That is the point for API payloads and config files, which routinely carry keys, tokens and customer records.