A laptop, a phone and a hand writing in a notebook on a wooden desk, banner image on the JSON Diff Checker page

ツール / Automate suite

JSON Diff Checker

Compare two JSON documents by meaning, with the rules you choose, and take the result away as a patch or a report.

Paste a before and an after. The checker ignores key order and formatting, tells you the path of every change, separates a changed value from a changed type, and lets you decide what counts: array order, matching by an id field, rounding noise, timestamps, null versus missing. Nothing leaves your browser.

Open the toolWhat is insideWhat it cannot do
Screenshot of the JSON Diff Checker tool

What is inside

What is inside the tool.

Semantic compare

Objects are compared key by key, so reordering keys or changing indentation produces no difference. Each change shows its path, such as $.users[id=2].role, and the before and after values.

Four kinds of change

Added, removed, changed (same type, new value) and type change (a number that became a string). A type change is called out on its own because 3 to "3" breaks code that a plain value change would not.

Three ways to read arrays

By position, the strict reading. Ignoring order, where equal items cancel out and extra duplicates still count. Or matched by a key field you name, such as id, so a reordered list of records shows only real edits, and records without the key are matched by equality.

Rules for noise

Ignore paths with patterns like $.meta.updatedAt, $..id or $.items[*].etag. Treat null and a missing key as equal. Trim strings. Ignore letter case. Set a number tolerance so 19.99 and 19.990000001 do not show up as a change.

Located errors

If a side is not valid JSON, the tool tells you the line and column, what it expected, and shows the line with a marker. A switch allows comments and trailing commas for config-style files.

Take the result away

Copy or download an RFC 6902 JSON Patch (position-based arrays), a Markdown report with counts, the options used and every change, or read a sorted-key line diff. Open files from disk; read locally.

Worked example

The sample you see on opening the tool, read three ways.

Before and After describe an API service. Between them: version 1.4.0 to 1.5.0, replicas 3 to "3", a price that differs by a rounding error, DEBUG false to true, a new TRACE setting, tags v1 to v2, one user's role changed, users listed in another order plus a new user, a new owner, and a new timestamp.

SettingsDifferences foundWhat you learn
Defaults (arrays by position)15Reordering the users makes every user look changed. Noisy, correct for strict comparison.
Match arrays by id, tolerance 0.001, ignore $.meta.updatedAt9: 4 added, 1 removed, 3 changed, 1 type changeOnly real edits: version, replicas type, DEBUG, TRACE, tag v1 replaced by v2, Sam is now editor, Kim added, owner added.
Same, then "Compare by position" for the patchA patch of replace, add and remove operationsApplying the patch to Before gives After. We test that on 400 random document pairs.

Reference

Exactly what each rule does.

Ignore-path patterns

PatternIgnores
$.meta.updatedAtThat one key. Ignoring an object also ignores everything under it.
$..idAny key named id at any depth.
$.items[*].etagThe etag key of every element of items.
$.a.*Every key directly under a.

Array modes

ModeMatches elementsBest for
By positionIndex to indexTuples, ordered steps, anything where order is meaning.
Ignore orderAny equal element, once eachTag lists, sets, ids.
By key fieldObjects with the same value in the named field; others by equalityLists of records with an id.

Paths and patches

Paths are shown in a JSONPath-like form for reading. Patches use JSON Pointer as RFC 6902 requires, with ~ written as ~0 and / as ~1. In key mode a path such as users[id=2] is a reading aid, which is why a patch is offered only for position-based comparison.

How to use it

Five steps for a clean answer.

Step 1

Paste both sides, or open files. If either side has a syntax error, fix it using the line and column shown.

Step 2

Start with defaults to see the strict difference, then add rules for noise one at a time so you know what each one hid.

Step 3

For lists of records, switch to key mode and name the field. A reordered list should show no changes.

Step 4

Add ignore paths for timestamps, etags and generated ids, and a tolerance for floating-point output.

Step 5

Copy the Markdown report into a review or ticket, or download the patch if the change should be applied.

What it cannot do

Limits.

No move detection

If an element changes position in position mode, you see changes at both positions. Use ignore order or key mode instead. The tool does not emit RFC 6902 move or copy operations.

Patches are position-based

A patch is generated only when arrays are compared by position, and it contains add, remove and replace. Tolerance, trimming and case rules mean the patch leaves values alone that the rules treat as equal.

Big files

Comparison runs on your device. A synthetic 20,000-key document pair compared in under a second in our test. The text diff view is skipped when the two sides are too large for a line-by-line comparison, and file open stops at 5 MB.

JSON only, with a JSONC option

The comments and trailing commas switch removes both before parsing. It does not accept other JSON5 features such as unquoted keys or single quotes. Duplicate keys follow the browser parser: the last one wins.

Large numbers

Numbers too long for a standard double, such as 9007199254740993, 1e400 or 0.12345678901234567, are kept as written and compared by their digits, so 9007199254740993 and 9007199254740992 are reported as different. 1.0, 1 and 1e0 are equal, and so are 100 and 1e2. A line above the result says how many numbers were compared this way, the changes list shows them as written, and the report and patch carry the original digits. Number tolerance is applied exactly, to the written digits, unless the numbers and tolerance span more than 20,000 decimal places, in which case they are compared exactly with no tolerance, and the result, report and patch note say so. A tolerance the tool cannot read is reported instead of ignored. Numbers with more than 9 exponent digits or more than 10,000 digits are refused with a message instead of being compared.

What it does

What it does.

Free JSON diff checker: semantic compare with exact paths, type changes, array matching by id or ignoring order, ignore paths, number tolerance, JSON5-style comments, RFC 6902 JSON Patch export and a Markdown report. It runs in your browser.

FunctionWhat it does here
Key order and indentation noiseIgnored
Exact path of each changeYes
Reordered list of recordsKey mode shows only edits
Timestamps and rounding noiseIgnore paths and tolerance
Machine-readable outputRFC 6902 patch and Markdown

Reading the result

What each readout means.

The summary line

Counts the differences by kind, for example "15 differences: 3 added, 0 removed, 11 changed, 1 type change". The chips under it show the same four counts.

Changed versus type change

Changed means the same path holds a different value of the same type. A type change means the type itself differs, for example the number 1 against the text "1".

The options

Array order, matching by an id field, rounding noise, timestamps and null versus missing all change what counts as a difference. If the count drops after you tick one, that option is what removed the differences.

The patch

The Patch tab compares arrays by position and its note says so. If two arrays were reordered, check that note before applying the patch to real data.

Common mistakes

What goes wrong, and what the tool does about it.

A reordered list shows as many changes

By position, ["a","b","c"] against ["c","a","b"] is three changes. Switch Arrays to Ignore order, or Match objects by key field, and the same pair is identical.

Expecting a patch from an order-insensitive comparison

The JSON patch tab is built only for comparing by position. In the other modes the tab says to switch Arrays back first.

Long numbers that look identical

Many tools read 9007199254740993 and 9007199254740992 as the same number. This tool keeps long numbers as written and reports them as different. A line above the result says when numbers were compared this way.

Duplicate keys

{"a":1,"a":2} is read as {"a":2}. The last value wins, as in a browser, so the first is not compared.

Questions

Before you ask.

Is my JSON uploaded?

No. Parsing and comparing run in your browser tab. Opening a file reads it locally.

Why does "3" versus 3 show as a type change?

Because many systems treat them differently. The tool never treats a number and a string as equal.

Why is there no patch in key mode?

A patch needs a path the receiving system can follow. Keyed paths like users[id=2] are not part of RFC 6902, so the patch tab asks you to switch to position-based comparison.

How does ignore order handle duplicates?

Each element on one side cancels one equal element on the other. [1,2,2] against [1,2] reports one extra 2.

Does it keep my documents?

No. Nothing is saved. Close the tab and they are gone.

What does it cost?

Nothing. No account.

Your data

What stays on your device.

The tool runs in this browser tab. It does not need a server to do its job. The two documents you paste stay in the page. Nothing is copied, downloaded or shared unless you press the button for it.

Keep going

Other tools you may want next.

Sources

References.

Try it

Paste two versions and see exactly what changed.

Open JSON Diff Checker
A wooden desk with glasses, a coffee cup, a plant and the edge of a laptop, banner image on the JSON Diff Checker page

Try it now.

JSON Diff Checker runs in your browser. No account needed.

Input To Output

Two documents in, every difference out

Before JSONAfter JSONA count bykindEvery paththat differsA patch and aMarkdownreportJSON DiffCheckerInOut
InBefore JSONAfter JSONJSON DiffCheckerA count by kindEvery path that differsA patch and a Markdown reportOut
Both sides compared as trees.

Pipeline

How a comparison runs

Both sides parse;errors get a lineand columnThe two trees arewalked side bysideEach difference isrecorded with itspathCounts, list, textdiff, patch andreport update
Both sides parse; errors get aline and columnThe two trees are walked side bysideEach difference is recorded withits pathCounts, list, text diff, patch andreport update
120 ms after you stop typing.

Bar Compare

The sample comparison

Added3 differencesRemoved0 differencesChanged11 differencesType changes1 differences
Added3 differencesRemoved0 differencesChanged11 differencesType changes1 differences
Arrays compared by position.

Bar Compare

Array modes on the same pair

By position15 differencesOrder ignored12 differencesMatched by id11 differences
By position15 differencesOrder ignored12 differencesMatched by id11 differences
Only the array rule changed.

Support Matrix

The four result tabs

Updates asyou typeCopy buttonDownloadbuttonShows pathsCounts bykindChangesText diffJSON PatchReport
ChangesUpdates as you typeShows pathsCounts by kindText diffUpdates as you typeJSON PatchUpdates as you typeCopy buttonDownload buttonShows pathsReportUpdates as you typeCopy buttonDownload buttonShows pathsCounts by kind
What each one holds.

Before After

A reorder, two ways

By positionMatched by idAda compared with Sam, fieldby field3 fields differ at users[0]3 more differ at users[1]Ada compared with Ada, Samwith Samnothing differs atusers[id=1]only the role differs:viewer to editor
By position to Matched by idAda compared with Sam, field byfieldAda compared with Ada, Sam with Sam3 fields differ at users[0]nothing differs at users[id=1]3 more differ at users[1]only the role differs: viewer toeditor
The same users array, reordered.

Before After

Number tolerance

SettingResult for $.priceTolerance 0Tolerance 0.001price is a changeprice is equal
Setting to Result for $.priceTolerance 0price is a changeTolerance 0.001price is equal
19.99 against 19.990000001.

Before After

null and a missing key

SettingResultOption off: {"x":null}against {}Option on: the same pair1 difference: x removed0 differences
Setting to ResultOption off: {"x":null} against {}1 difference: x removedOption on: the same pair0 differences
An option joins them.

Before After

Messy strings

SettingResult" Hi " against "hi", optionsoffThe same pair, trim andignore case on1 changed entryidentical
Setting to Result" Hi " against "hi", options off1 changed entryThe same pair, trim and ignore caseonidentical
Two cleanup options.

Before After

Comments and trailing commas

TextResult{"a":1,} with the option offThe same text with theoption onan error: Expected a quotedkeyparses and compares
Text to Result{"a":1,} with the option offan error: Expected a quoted keyThe same text with the option onparses and compares
The JSONC option.

Before After

A syntax error, located

PasteShownThe messageUnder the source lineThe summaryLine 1, column 8: Expected aquoted keya caret marks the commaFix the JSON on the Beforeside to compare
Paste to ShownThe messageLine 1, column 8: Expected a quotedkeyUnder the source linea caret marks the commaThe summaryFix the JSON on the Before side tocompare
{"a":1,} on the Before side.

Before After

Ignoring a path

SetupSample totalNothing ignored$.meta.updatedAt ignored15 differences14 differences
Setup to Sample totalNothing ignored15 differences$.meta.updatedAt ignored14 differences
updatedAt changes on every deploy.

Input To Output

JSON Patch

The samplepair, arraysby position15 operationsreplace, addand removeApplying ityields theAfter documentJSON Patch tabInOut
InThe sample pair, arrays bypositionJSON Patch tab15 operationsreplace, add and removeApplying it yields the AfterdocumentOut
RFC 6902, position mode only.

Before After

Three of the fifteen patch operations

OperationValuereplace /versionadd /env/TRACEadd /users/2"1.5.0"1{"id":3,"name":"Kim","role":"viewer"}
Operation to Valuereplace /version"1.5.0"add /env/TRACE1add /users/2{"id":3,"name":"Kim","role":"viewer"}
Paths are JSON Pointers.

Input To Output

The report

The samplecomparison# JSONcomparison15 differences:3 added, 0removed, 11changed, 1 typechangeA section perkind, withpathsReport tabInOut
InThe sample comparisonReport tab# JSON comparison15 differences: 3 added, 0removed, 11 changed, 1 type changeA section per kind, with pathsOut
Markdown, ready to paste.

Pipeline

Ignore order, how matching works

Each Before itemlooks for an equalAfter itemA matched item isused only onceWhatever is leftis added orremoved
Each Before item looks for anequal After itemA matched item is used only onceWhatever is left is added orremoved
For arrays whose order is noise.

Pipeline

Every keystroke

120 ms after thelast changeBoth sidesre-parseThe diff re-runsAll four tabsupdate
120 ms after the last changeBoth sides re-parseThe diff re-runsAll four tabs update
No compare button.

Before After

Swap sides

Before vs AfterAfter vs Before3 added, 0 removed11 changed, 1 type change0 added, 3 removed11 changed, 1 type change
Before vs After to After vs Before3 added, 0 removed0 added, 3 removed11 changed, 1 type change11 changed, 1 type change
One button.

Input To Output

Long numbers stay exact

A 25-digitinteger on onesideThe samedigits plusone on theotherCompared bytheir writtendigitsA note sayshow manynumbers thiscoveredJSON DiffCheckerInOut
InA 25-digit integer on one sideThe same digits plus one on theotherJSON DiffCheckerCompared by their written digitsA note says how many numbers thiscoveredOut
No rounding to a double.

Authored Tiles

The dials

4 change kinds3 array modes7 options4 result tabs
4 change kinds3 array modes7 options4 result tabs
From the code.