JSON diff tool macOSWindows

Compare JSON by keys and values, not line position

A local JSON diff tool with semantic comparison, ignored paths, keyed or unordered arrays, and numeric tolerance, plus Pro profiles and reports.

Direct answer

How does semantic JSON comparison differ from a text diff?

Diff Anything parses JSON before comparing it, so formatting and property order do not create meaningless line changes. Lists of records are matched by an id field automatically, numbers compare by value, and applying a change keeps the target file's comments and layout. Pro profiles can retain ignored paths, keyed or unordered array behavior, case rules, numeric tolerances, and review state.

A two-minute walkthrough on a Mac: compare two versions of a settings file whose keys were reordered, see the seven real changes, and ignore a time stamp with one click. Watch on YouTube

Formatting noise

Key order and spacing are not changes.

A line diff of two JSON files often shows hundreds of changes after a serializer sorts keys differently or changes the indentation. Diff Anything parses both documents first and compares the values, so the same data written in a different order or layout produces no differences.

When a value changes type, for example from the string "1" to the number 1, it is reported as a type change instead of an ordinary value change. Numbers are compared by value, so 1, 1.0 and 1e0 are equal, and numbers too large or precise for ordinary arithmetic keep their exact digits. To treat small differences as equal, set a Numeric tolerance above 0.

Files with // or /* */ comments or trailing commas are accepted. If a document repeats a key, the last value is used and a warning names the duplicate. When only one file repeats the key, that warning counts as a difference.

Arrays

Match array items by a key instead of by position.

Arrays are where most JSON diffs go wrong. When every item of an array is an object with a unique id, _id, uuid or key field, Diff Anything pairs the items by that field automatically. Locations then read like $.users[id=2].role, an inserted record is reported as added instead of shifting every record after it, and a list whose records only moved shows one note, such as "Array members at $.users were reordered".

Other arrays are compared by index. If both hold the same items in a different order, the result reports one reorder instead of a change at every position. For lists of records identified by another field, add an Array keys rule such as $.orders = orderNumber, and locations read like $.orders[orderNumber=1042].total. When every object shares a unique field such as name, Recommended rules offers it as a one-click suggestion, for example "Compare $.servers by name".

If a key is missing from an item or repeated, an Array keys rule cannot be used and the comparison falls back to array indexes with a warning. For lists where order does not matter, such as tags, add the path to Unordered array paths.

Semantic rules

Hide fields you expect to change.

Open Semantic rules to tell the comparison what to leave out. Ignore paths removes volatile fields such as $.metadata.generatedAt. Ignore case at paths compares string values at those paths without letter case. Numeric tolerance treats numbers within a fixed absolute difference as equal.

A path is either exact or ends in .* to cover everything below it. Recommended rules looks at the current result and suggests array keys, ignored order, case rules, volatile fields such as generatedAt, and numeric tolerances, so you can add a rule with one click. Rules are part of the free plan; saving them in a profile for the next run needs Pro.

  • Ignore paths
  • Unordered array paths
  • Ignore case at paths
  • Array keys (one path = key per line)
  • Numeric tolerance

Apply and CLI

Copy a change into the other file.

Select a difference and use Right → left or Left → right to copy it into the other file. Only that value is written: the target keeps its comments, trailing commas, indentation and line endings.

The command line compares JSON on the free plan with the default rules, and --exit-code returns 1 when the files differ. Semantic rules set in the app are not read by the command line.

Best for

Where this workflow fits.

  • Configuration files whose key order changes
  • API responses with volatile fields or unordered collections
  • Sensitive JSON that should remain on the local machine

No accounts, cloud comparison service, analytics, or telemetry.

Relevant capabilities

What Diff Anything brings to the job.

Practical workflow

From setup to a reviewed result.

  1. Open both JSON files

    Choose files or paste JSON. Auto opens them in JSON mode in the Tree view; the Semantic tab lists every difference.

  2. Remove known noise

    Add Ignore paths for timestamps and request ids, or accept a suggestion from Recommended rules.

  3. Key your arrays

    Records with an id, _id, uuid or key field are paired automatically. For other records, add an Array keys rule or accept a suggestion such as Compare $.servers by name.

  4. Review and copy changes

    Filter by Added, Removed, Changed or Types, mark items reviewed, and copy the values you want across.

Useful in practice

Direct answers

Questions about JSON diff tool.

How does semantic JSON comparison differ from a text diff?

Diff Anything parses JSON before comparing it, so formatting and property order do not create meaningless line changes. Lists of records are matched by an id field automatically, numbers compare by value, and applying a change keeps the target file's comments and layout. Pro profiles can retain ignored paths, keyed or unordered array behavior, case rules, numeric tolerances, and review state.

Does Diff Anything ignore JSON key order?

Yes. Objects are compared by key, so the same keys in a different order are equal. Keys themselves are case-sensitive.

Can it compare JSON arrays whose items are in a different order?

Yes. Records with a unique id, _id, uuid or key field are paired by it automatically. For other records, add an Array keys rule such as $.servers = name; Recommended rules suggests one when every item has a unique shared field. For simple lists, add the path under Unordered array paths. Other arrays are compared by index, and an array whose items only moved is reported as reordered.

Which path syntax do ignore rules use?

Paths start at $, for example $.metadata.generatedAt. A path ending in .* also covers everything below it. Wildcards in the middle of a path, [*], and recursive descent (..) are not supported.

Are JSON comparison rules part of the free plan?

Yes. Semantic JSON comparison and its rules are included in the free plan, within the 5 MB per file and 10 comparisons per day limits. Saving rules in a profile and exporting reports need Pro.

Go deeper

Choose sources, understand automatic detection, and select the engine that answers the question you are actually asking.

Read Choose the right comparison mode
Free & Pro: what’s included

Available on the Mac App Store and Microsoft Store. Free desktop use lets you try every comparison engine for files up to 5 MiB per side and 10 new comparison sessions per local day; collection previews show the first 100 items and PDF previews show the first 3 pages. The free CLI supports text and JSON. A one-time Pro purchase removes the preview and session limits and unlocks larger sources within technical limits, saved profiles and history, report export, three-way merge, folder synchronization, batch manifests, trusted preprocessors, and every CLI mode.

More Diff Anything

Browse every focused tool and workflow.

See all Diff Anything tools