Free tool

JSON diff (structural compare)

Find what changed between two JSON documents by path, ignore noise such as timestamps and ids, and export the exact JSON Patch.

Original JSON (A)
New JSON (B)
7 differences
  • Changed

    "Ada Lovelace"

    + "Ada King"

  • Added

    + "owner"

  • Changed

    "dark"

    + "light"

  • Type change

    true

    + "yes"

  • Changed

    "pending"

    + "shipped"

  • Added

    + {"id":3,"total":42.5,"status":"paid"}

  • Added

    + null

Limits
  • Integers above 2^53 lose precision when parsed with JSON.parse, as in any browser.
  • If a key is duplicated in the same object, the last occurrence wins.
  • Huge arrays (over 4 million comparison cells) are compared by position instead of alignment.
  • Everything runs in your browser: JSON is never sent to a server.

Built by

Miguel Ángel Colorado Marin (MACM)

Full-Stack Developer · Guadalajara, España

I develop web apps, digital tools and full projects — from design to deployment.

Contact me

A text diff is useless for JSON: reordering keys, reformatting or inserting an item at the start of an array marks half the document as different. This tool works on structure. It walks both documents, aligns arrays with the longest common subsequence algorithm and shows only the real changes with their path. Built for comparing API responses, config files or test fixtures, it can match objects by id, ignore volatile fields such as timestamps and export the RFC 6902 JSON Patch that turns A into B, verified against thousands of random cases.

Features

  • Structural diff: key order and formatting never produce false changes
  • Classifies each difference as added, removed, changed or type change
  • Array alignment: inserting an item at the start is one change, not N
  • Matches arrays of objects by a key (id, sku, email…) even when order changes
  • Ignored paths with wildcards: updatedAt, items[*].id or **.etag
  • Numeric tolerance to compare floats and options for case and whitespace
  • Generates the exact RFC 6902 JSON Patch from A to B and applies any patch
  • Tells null apart from a missing key and flags syntax errors with line and column

How do I compare two JSON documents?

  1. 1

    Paste or load both JSON documents

    Put the original in A and the new one in B, or load .json files. Syntax errors are flagged with line and column.

  2. 2

    Tune the comparison

    Set the key to match arrays, the paths to ignore, the numeric tolerance or whether to ignore order and case.

  3. 3

    Review the changes

    Filter by change type or path and copy any path with one click.

  4. 4

    Export or apply the patch

    Copy the generated JSON Patch or paste your own to apply it to A and see the result.

Frequently asked questions

How is it different from a text diff?

A text diff compares lines, so a change in indentation or key order shows up as a difference. This tool compares values by path: two JSON documents with the same keys in a different order are identical.

What is a JSON Patch?

It is a standard format (RFC 6902) that describes changes as a list of add, remove or replace operations on JSON Pointer paths. It is used in APIs with the HTTP PATCH method and to sync state. The generated patch turns A exactly into B.

How do I ignore fields like updatedAt or generated ids?

Add them to "Ignore paths". A bare name ignores that key at any level; a path like items[*].createdAt uses * for one level and ** for any depth.

What does matching arrays by key do?

If an array holds objects with an identifier, it compares them by that value instead of by position. Reordering a list of orders produces no changes and you only see the orders that were changed, added or removed.

Why doesn't the JSON Patch follow the comparison options?

Because a patch must reproduce B exactly. The options make the report easier to read; the patch describes the full transformation and is validated by applying it to A.

Is my JSON uploaded to a server?

No. The analysis runs in your browser, so you can compare responses containing private data or tokens without them leaving your device.

Related tools

Embed JSON Diff on your site

Add JSON Diff to any web page with a simple iframe. Free, with attribution to miguelacm.es.

<iframe
  src="https://miguelacm.es/embed/json-diff"
  width="100%"
  height="700"
  frameborder="0"
  title="JSON Diff — miguelacm.es"
></iframe>
View embed in new tab →