Skip to main content
UFOZoo

JSON Diff: Compare Two JSON Files Online & Find Changes

JSON diff online: compare two JSON files side by side, highlight added, removed, and changed values, and copy the result.

Updated 2026-08-16

Related Tools

Features

  • Real-time comparison: paste two JSON documents and differences update instantly as you type
  • Tree view with three-color highlighting: green + for added keys, red − for removed, yellow ~ for modified
  • Path-level change location: every difference is pinpointed with a full path like a.b[2].c
  • Change statistics: added, removed, and modified counts shown in the result header
  • Object key order is ignored: two objects with the same keys in different order are considered equal
  • Smart array comparison: object elements with matching id or name values are paired first, remaining elements are compared by index
  • Changes-only mode: collapse identical parts and focus on exactly what changed
  • Copy the diff as plain text: paste it into tickets, pull requests, or chat messages
  • Open .json files from disk or drag and drop them onto the panels
  • Handles large nested structures: deeply nested objects and arrays are compared without depth limits

How to Use

  1. 1Paste your original JSON into the left panel (JSON A) and the updated version into the right panel (JSON B).
  2. 2Watch the diff update in real time: added keys appear in green, removed in red, modified in yellow.
  3. 3Toggle 'Changes only' to hide identical parts and see just the differences; switch back to 'Show all' for the full tree.
  4. 4Read the statistics badges in the result header: +N added, −N removed, ~N modified.
  5. 5Click Copy diff to copy a plain-text summary of every change, or Save to download it as a file.
  6. 6Compare API response changes: capture a response before and after a deploy to verify nothing broke.
  7. 7Validate config file migrations: compare old and new configs to confirm exactly which fields were added or removed.
  8. 8Review a colleague's PR data changes: paste the old and new payloads side by side and spot unintended edits.
  9. 9Use the Open file button or drag-and-drop to load .json files instead of pasting.
  10. 10Fix broken JSON by checking the red error hint in the panel: the affected line is highlighted in the gutter.

Frequently Asked Questions

How do I compare two JSON files?

Paste the original document into the left panel (JSON A) and the changed one into the right panel (JSON B). The diff tree appears immediately below: green + for added keys, red − for removed keys, and yellow ~ for modified values. You can also load files with the Open file button or drag-and-drop.

What do added, removed, and changed mean?

Added means a key exists only in JSON B, removed means it exists only in JSON A, and changed means the key exists in both but with a different value (or a different type, e.g. a string turned into a number). Unchanged parts are shown in gray in 'Show all' mode and hidden in 'Changes only' mode.

How are arrays compared?

Object elements are first matched by an equal id or name value, so a reordered list of records stays readable; only the fields that actually changed are highlighted. Elements without a matching id/name are compared by index: if item[0] is replaced by a completely different object, every field shows as modified. Pure value arrays like [1,2,3] are always compared by index, so shifting an element to another position is reported as a change at that position (e.g. [1,2,3] vs [1,3,2] shows indexes 1 and 2 as modified), and a length difference is reported as added or removed indexes.

Does object key order count as a difference?

No. Objects are compared by key, not by the order keys appear in the text. {"a":1,"b":2} and {"b":2,"a":1} are considered identical, so a reformatted file with reordered keys produces no false positives.

Does array element order count as a difference?

It depends on the element type, which is different from objects. For arrays of objects, elements with matching id or name values are paired, so pure reordering is not a difference. For value arrays (numbers, strings, booleans) and for elements that cannot be paired, position matters: the comparison is index-based, so a reordered element is reported as a modified value at its new index, and a length mismatch is reported as added or removed indexes.

Can I merge two JSON documents with this tool?

No. This is a comparison tool only: it shows what differs but does not produce a merged document. If you need a merge, use the diff as a guide and apply the changes manually in your editor, or use a dedicated JSON merge library in your project.

Will large JSON files slow it down?

Documents up to a few megabytes compare instantly in most browsers. For very large files, rendering the full tree can feel slow; switch to 'Changes only' mode to reduce the output. For multi-hundred-MB files, we recommend command-line tools instead: jq -S . file1.json > f1.sorted.json (same for file 2) and then diff f1.sorted.json f2.sorted.json.

What happens if both documents are invalid JSON?

Each panel validates independently. A panel with invalid JSON shows a red error hint with the parser message and highlights the offending line in the gutter, while the other panel keeps working. The diff result panel only compares when both sides parse successfully.

How is this different from a text diff tool?

A text diff (like text-diff-checker) compares line by line, so a single reformatting of the document produces thousands of noise changes. This tool parses both documents and compares them structurally: key order, whitespace, and formatting are ignored, and every difference is reported as a semantic path like data.items[2].price.

Why does my diff show changes I didn't make?

Three usual culprits: (1) type mismatches: "1" (string) vs 1 (number), or null vs "", look the same but are reported as modified; (2) array reordering: value arrays compare by index, so moving an element flags it as changed; (3) trailing spaces or line breaks inside string values count as changes, while indentation and key order are ignored. Check the yellow ~ paths; old and new values are shown side by side.

What is the best way to check the difference between two JSON files?

It depends on the context. For a one-off check, paste both documents here and read the +/−/~ paths, quick and visual. For automation or CI, sort both files with jq -S . and run diff. In git, git diff or VS Code's compare view renders JSON diffs nicely. All of these compare structure, not formatting.

Can it compare JSONL files?

No. Each input must be a single valid JSON document, and JSONL (JSON Lines) contains one document per line. To compare JSONL files, compare them line by line with a text diff tool, or use jq to convert them: jq -c . file.jsonl > normalized.jsonl before a text diff.

Why is comparing minified JSON with this json diff online tool so hard to read?

Minified JSON puts the entire document on one line, so any structural change makes the line look completely different. This tool parses both sides and compares them structurally, so it can still pinpoint the exact changed path, but pasting pretty-printed versions first makes the result much easier to read. Format both documents with a JSON formatter before diffing.

Why does my json diff checker show an entire object as changed when only one child value changed?

Structural comparison reports the full path from the root whenever any descendant differs; something like data.items[2].price. That is not an error: every object along the path is marked so you can navigate to the change. Only the leaf value actually differs; identical values are never marked.