Compare two JSON files by meaning on Windows, with the path of every difference
Key order and number spellings are not changes. How to see what really changed between two JSON files, with the path of each difference, without uploading them.
We make JSON Toolkit, the app this guide uses. The free methods come first; every step shown in JSON Toolkit was checked in the app itself, and the screenshots come from the real app with invented sample data.
Short answer
A line-by-line diff of two JSON exports reports key order, line breaks and number spellings as changes, and says nothing about a duplicate key. The free way that comes closest is to sort the keys with Python's json.tool and compare the results with fc.exe, but it still flags 5.0 against 5 and orders that only moved. A comparison by meaning matches list items by their id, treats 5.0 and 5 as one number and gives the path of each real difference: JSON Toolkit does that on your PC, with schema checks that point to the line.
Why a text diff of JSON misleads
JSON is text, but most of its text carries no meaning. The JSON standard, RFC 8259, defines an object as an unordered collection of names and values, so two exports with the same data can list the keys in another order. It also says that names within an object should be unique, and that software behaves unpredictably when they are not; and it warns that integers outside the range that double-precision numbers hold exactly (above 253 minus 1) may not be read exactly by every program.
Numbers have several spellings too: 59.90 and 59.9 are the same price. And lists are where real changes hide: a DEV post on reading a JSON diff makes the distinction: another key order is not a change, another array order is. When an export lists the same orders in another sequence, a line diff compares each order with the wrong one.
Method 1 (free): sort the keys with json.tool, then compare with fc.exe
Python's standard library has a command-line formatter, documented on the json module page, whose --sort-keys option writes every object's keys in alphabetical order. Windows has fc.exe to compare two text files. In Windows PowerShell, type fc.exe in full: there, fc alone is an alias of Format-Custom. We ran this on 30 November 2026 (Python 3.11.9, Windows PowerShell 5.1) in the folder that holds two invented order exports of a shop:
py -3 -m json.tool --sort-keys orders-2026-10.json oct-sorted.json
py -3 -m json.tool --sort-keys orders-2026-11.json nov-sorted.json
fc.exe /N oct-sorted.json nov-sorted.json
The key order is gone, but fc.exe still reported 10 blocks of differences in two files of 54 lines. The orders are not in the same sequence in the two exports, so it compares order 1041 with order 1042, and so on down the file. Within order 1041, which did not change, json.tool wrote the price of one item as 5.0 in October and 5 in November, and its quantity as 2 against 2.0: the same values, spelled differently, so they show as differences even after sorting.
The October file also has a problem the comparison hides: order 1041 has two "status" keys, "paid" then "shipped". json.tool kept the last one and said nothing, as the Python documentation describes, so the sorted file no longer shows it. ConvertFrom-Json does the same in Windows PowerShell 5.1; it did read the 20-digit tracking number exactly:
$a = Get-Content orders-2026-10.json -Raw | ConvertFrom-Json
$a.orders[0].status
$a.orders[0].tracking
$a.orders[0].tracking.GetType().Name
shipped
40917722310158811234
Decimal
Free tools that compare by structure exist. Trail of Bits describes Graphtage, a command-line tool installed with pip that compares JSON and other formats by their structure, and JSON Diff (jdd) is an open-source page that compares in the browser and says the data is not sent; working offline means keeping a local copy. We did not test either of them.
Method 2: compare by meaning with JSON Toolkit
JSON Toolkit is our Windows app for this job. It checks, formats and converts JSON, JSON Lines, YAML and CSV, validates files against a JSON Schema with the location of each error, and compares two files by meaning with the path of every difference. It runs offline, on files up to 100 MB each. The screenshots below come from version 1.0.0 (evaluation build) with the same invented exports.
- Add the files. Each one is checked for syntax and problems, with the line, column and path of each. The October export got two warnings: the 20-digit tracking number, which JavaScript reads as 40917722310158810000, and the duplicate
"status"key (2 times, lines 9 and 16). - Check them against a schema if you have one. With our invented order schema (draft 2020-12), the November export got 2 errors and 1 warning: on line 19, the status
"refunded"is not one of the allowed values; on line 23, a quantity of 0 is below the minimum of 1. - Compare. Choose file A and file B; list items are matched automatically by a field such as id, key or name. Here the orders were matched by
"id"and their items by"sku", and the app found 5 differences: the export date, order 1042's total and the price of its MUG-ENAMEL item (24.50 to 26.50), order 1043 only in A and order 1045 only in B. - Save the differences to a CSV file: one row per difference, with its path, the change and the values in A and B.
Nothing is reported for order 1041. Its place in the list, its key order, 59.90 against 59.9, 5.00 against 5 and 2 against 2.0 are not differences in meaning. Its duplicate key is not lost either: the file check in step 1 flags it.
![JSON Toolkit comparing two order exports: 5 differences, each with its path such as orders[id=1042].total, the change and the values in A and B, above both files formatted with the changed lines highlighted.](/media/guides/compare-two-json-files-by-meaning/08-compare-by-meaning.thumb.182e8390b575.webp)


Copies in other formats (formatted or minified JSON, YAML, CSV) are written as new files, never over a file. When an export ends up in a spreadsheet, our guide to cleaning a CSV file offline covers the next step.
Limitations
- json.tool and fc.exe compare lines: they cannot match orders or items by id, they report number spellings as changes, the duplicate key disappears without a warning, and fc.exe gives line numbers, not JSON paths.
- JSON Toolkit compares two files at a time and reads files up to 100 MB each. Lists are matched by a field such as id, key or name; the result shows which field it used for each list.
- A schema check is only as good as the schema: the app checks the rules you give it.
- JSON Toolkit's planned requirements: Windows 10 (22H2) or 11, 64-bit.
References
- IETF: RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format
- Python documentation: json, JSON encoder and decoder
- Microsoft Learn: ConvertFrom-Json (Windows PowerShell 5.1)
- Trail of Bits: Graphtage
- DEV Community: How to compare two JSON files and read the diff correctly
- GitHub: JSON Diff (jdd)