Tutorial · JSON Diff · 4 min read

How to Compare Two JSON Files Online

Compare two JSON documents by structure, not text: every key added, removed or changed is listed with its full path. Whitespace and key order are ignored.

A text diff of two JSON files is noisy: reordered keys and re-indented blocks show up as changes even when the data is identical. A structural diff parses both documents and compares values by path, so you see only what actually changed, for example replicas going from 2 to 3 or a new environment variable.

What you'll learn

  • Diff JSON by value and path instead of by line
  • Read added, removed and changed entries with dot and bracket paths
  • Ignore key order and formatting differences automatically

Step by step

  1. Paste the original on the left

    Open JSON Diff and paste the earlier version, for example the config currently deployed, into Original.

  2. Paste the new version on the right

    Paste the candidate into Changed. Both must be valid JSON; an error names which side failed and where.

  3. Click Compare

    Each difference is listed with a badge and a path. CHANGED b.c: 2 → 3 means the value at b.c moved from 2 to 3; ADDED d[2]: 3 means a third element appeared in array d.

    {"replicas":2,"image":"api:1.4.0"}
    vs
    {"replicas":3,"image":"api:1.5.0","env":{"DEBUG":"on"}}
    
    CHANGED  replicas: 2 → 3
    CHANGED  image: "api:1.4.0" → "api:1.5.0"
    ADDED    env: {"DEBUG":"on"}
  4. Copy the report

    Copy Results gives you the list as plain text for a review comment or a change ticket.

Open the tool with this example Runs in your browser. Nothing you paste is uploaded.

Common problems

Everything shows as changed

Check that one side is not wrapped in an extra array or object, for example [{...}] against {...}. The diff compares from the root.

Arrays report changes after reordering

Array elements are compared by index, because JSON arrays are ordered. If order does not matter in your data, sort both arrays first.

FAQ

Does key order matter?

No. Objects are compared by key, so {"a":1,"b":2} and {"b":2,"a":1} are identical.

Is either document uploaded?

No. The comparison runs entirely in your browser.