Use jq to first sort all keys. Then diff to do the diffing:
jq -S . A.json > A-sorted.json
jq -S . B.json > B-sorted.json
diff A-sorted.json B-sorted.json
The above example is for Linux but both jq and diff is available for Windows.
It seems Windows has an alternative diff tool called fc, perhaps this could be used instead of diff.
JSON Diff
jsondiff.com
JSON Diff - The semantic JSON compare tool
Validate, format, and compare two JSON documents. See the differences between the objects instead of just the new lines and mixed up properties.
JSON Compare
jsoncompare.org
JSON Compare - Best JSON Diff Tools
JSON Compare helps to Compare and find diff in JSON data.
windows - Offline JSON diff tool - Software Recommendations Stack Exchange
I am looking for a similar tool like JSON diff tool but with the additional requirement that the tool works offline. I am asking a new question, because many answers over there do also not fit the More on softwarerecs.stackexchange.com
Best way to diff two JSON files and write differences data to third file?
The difflib module is a python standard module that has methods to help compare data, such as context_diff() or ndiff(). More on reddit.com
New JSON diff algorithm
This really should be in JavaScript and on npm. Maybe write a version in c like node-sass More on reddit.com
A good method for finding any differences between two json files?
So I have 2 json files that I need to compare, and after a certain known event there is an expected difference somewhere in the files, and I'm trying to verify what that difference is and that there aren't any other differences. More on reddit.com
Videos
04:21
Compare Two JSON Files in Python | 5 different ways to compare ...
05:50
1. DeepDiff: Smarter JSON Comparison using Python - YouTube
06:52
Calculate difference between 2 json objects - YouTube
05:59
Comparing JSON Made Easy with Playwright - YouTube
01:39
How to Easily Compare Two JSON Files in Python - YouTube
00:59
json vs json string explained | Web development - YouTube
JSON Diff
json-diff.com
JSON Diff - Compare and Find Differences in JSON Files Online
JSON Diff is a free and open-source tool to compare two JSON objects and find differences. Visualize changes in JSON files, easy and fast.
SemanticDiff
semanticdiff.com โบ online-diff โบ json
SemanticDiff - Online JSON Diff
The tool compares JSON objects and arrays by first parsing them into a data structure that is independent of their textual representation. This helps us ignore changes that are unrelated to the encoded values, such as adding optional commas or whitespace outside of strings.
Jsondiff
jsondiff.net
JSON Diff - Compare JSON Objects Online
Free online JSON diff tool. Compare two JSON objects side by side with syntax highlighting, character-level diffs, and instant validation.
npm
npmjs.com โบ package โบ json-diff
json-diff - npm
May 15, 2023 - % json-diff --help Usage: json-diff [-vCjfonskKp] first.json second.json Arguments: <first.json> Old file <second.json> New file General options: -v, --verbose Output progress info -C, --[no-]color Colored output -j, --raw-json Display raw JSON encoding of the diff -f, --full Include the equal sections of the document, not just the deltas --max-elisions COUNT Max number of ...s to show in a row in "deltas" mode (before collapsing them) -o, --output-keys KEYS Always print this comma separated keys, with their value, if they are part of an object with any diff -x, --exclude-keys KEYS Exclude these comma separated keys from comparison on both files -n, --output-new-only Output only the updated and new key/value pairs (without marking them as such).
ยป npm install json-diff
Published ย May 15, 2023
Version ย 1.0.6
Author ย Andrey Tarantsov
Repository ย https://github.com/andreyvit/json-diff
Homepage ย https://github.com/andreyvit/json-diff
GitHub
github.com โบ RexSkz โบ json-diff-kit
GitHub - RexSkz/json-diff-kit: A better JSON differ & viewer, support LCS diff for arrays and recognise some changes as "modification" apart from simple "remove"+"add". ยท GitHub
You can use your own component to visualize the diff data, or use the built-in viewer: import { Viewer } from 'json-diff-kit'; import type { DiffResult } from 'json-diff-kit'; import 'json-diff-kit/dist/viewer.css'; interface PageProps { diff: [DiffResult[], DiffResult[]]; } const Page: React.FC<PageProps> = props => { return ( <Viewer diff={props.diff} // required indent={4} // default `2` lineNumbers={true} // default `false` highlightInlineDiff={true} // default `false` inlineDiffOptions={{ mode: 'word', // default `"char"`, but `"word"` may be more useful wordSeparator: ' ', // default `""`, but `" "` is more useful for sentences }} /> ); };
Author ย RexSkz
Top answer 1 of 5
3
Use jq to first sort all keys. Then diff to do the diffing:
jq -S . A.json > A-sorted.json
jq -S . B.json > B-sorted.json
diff A-sorted.json B-sorted.json
The above example is for Linux but both jq and diff is available for Windows.
It seems Windows has an alternative diff tool called fc, perhaps this could be used instead of diff.
2 of 5
2
QT JSON Diff [Github] might be for you:
- They have a Windows build (see "Win64" in the releases)
- It is gratis, MIT license
- It works offline, as an EXE which runs locally
- can sort objects inside arrays so that order matters less
Json2html
json2html.dev โบ json-diff.html
JSON Compare Tool - Free JSON Diff Online | json2html.dev
Compare JSON files side-by-side with visual diff highlighting. Free tool with export options and real-time analysis.
npm
npmjs.com โบ package โบ json-diff-ts
json-diff-ts - npm
3 weeks ago - Calculate and apply differences between JSON objects with advanced features like key-based array diffing, JSONPath support, and atomic changesets.. Latest version: 4.10.0, last published: 3 days ago.
ยป npm install json-diff-ts
Published ย Mar 06, 2026
Version ย 4.10.0
Author ย Christian Glessner
Repository ย https://github.com/ltwlf/json-diff-ts
Homepage ย https://github.com/ltwlf/json-diff-ts#readme
JSON Compare
jsoncompare.com
JSON Compare - View, Format & Validate Diff Files | JSON Compare
Compare two JSON files side by side with real-time diff highlighting. Identify additions, deletions, and modifications instantly. Free online JSON comparison tool.
JSON for Modern C++
json.nlohmann.me โบ api โบ basic_json โบ diff
diff - JSON for Modern C++
#include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // the source document json source = R"( { "baz": "qux", "foo": "bar" } )"_json; // the target document json target = R"( { "baz": "boo", "hello": [ "world" ] } )"_json; // create the patch json patch = json::diff(source, target); // roundtrip json patched_source = source.patch(patch); // output patch and roundtrip result std::cout << std::setw(4) << patch << "\n\n" << std::setw(4) << patched_source << std::endl; }
npm
npmjs.com โบ package โบ json-diff-kit
json-diff-kit - npm
November 23, 2025 - A better JSON differ & viewer library written in TypeScript.
ยป npm install json-diff-kit
Published ย Mar 03, 2026
Version ย 1.0.35
Author ย Rex Zeng
Repository ย https://github.com/RexSkz/json-diff-kit
Visual Studio Marketplace
marketplace.visualstudio.com โบ items
JSON Diff Pro - Visual Studio Marketplace
Extension for Visual Studio Code - A powerful tool for comparing and visualizing differences between JSON objects, featuring an intuitive interface with advanced formatting, error handling, and real-time diff generation.