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.

Answer from Jacob on Stack Exchange
๐ŸŒ
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.
Discussions

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
๐ŸŒ softwarerecs.stackexchange.com
Built a Tool for Deep JSON Comparison - Seeking Input on Array Diff Visualization
jq + diff = totally enough More on reddit.com
๐ŸŒ r/golang
6
4
July 30, 2024
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
๐ŸŒ r/learnpython
7
1
August 20, 2017
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
๐ŸŒ r/programming
8
35
October 1, 2015
๐ŸŒ
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.
๐ŸŒ
Coders Tool
coderstool.com โ€บ json-compare
JSON Compare Tool Online: Diff Two JSON Files Fast
Use our JSON Compare tool to identify differences between two JSON files. Perfect for debugging APIs, data validation, and quick comparisons.
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
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 }} /> ); };
Starred by 209 users
Forked by 17 users
Languages ย  TypeScript 92.7% | Less 4.7% | JavaScript 2.6%
๐ŸŒ
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
๐ŸŒ
IT Tools
it-tools.tech โ€บ json-diff
JSON diff
Collection of handy online tools for developers, with great UX. IT Tools is a free and open-source collection of handy online tools for developers & people working in IT.
๐ŸŒ
JSON Formatter
jsonformatter.org โ€บ json-compare
JSON Compare Online to find different between two json
JSON Compare tool to compare two JSON data with ease. It helps to find the different between two json to find the accurate results.
๐ŸŒ
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
1 month 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
๐ŸŒ
Proxyman
proxyman.com โ€บ home โ€บ tools โ€บ diff
JSON Diff: Free Online JSON Diff Tool | Build by Proxyman
Free & Secure JSON Diff Tool. Compare JSON files side-by-side with syntax highlighting. All processing occurs locally in your browser - no data leaves your device.
Published ย  October 8, 2024
๐ŸŒ
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; }
๐ŸŒ
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.
๐ŸŒ
TaroBall
online-free-tool.appspot.com โ€บ json compare and json diff โ€บ home
JSON Compare and JSON Diff - Online Free Tool
December 25, 2022 - This online tool allows users to compare the contents of two JSON data sets and identify any differences between them. It provides a clear, detailed view of the differences, including the specific keys and values that are different in each data set.
๐ŸŒ
Todiagram
todiagram.com โ€บ compare โ€บ json
JSON Diff Tool - Fast & Free JSON Compare | ToDiagram
Tooltips show exact JSON paths and values to make fixes straightforward in PRs and reviews. Understand changes across nested arrays and objects without scanning line diffs or worrying about order.
๐ŸŒ
Reddit
reddit.com โ€บ r/golang โ€บ built a tool for deep json comparison - seeking input on array diff visualization
r/golang on Reddit: Built a Tool for Deep JSON Comparison - Seeking Input on Array Diff Visualization
July 30, 2024 -

Hey r/golang community,

I've been grappling with a recurring challenge in my work: comparing large, deeply nested JSON files. To tackle this, I created a CLI tool in Go that helps highlight differences between two JSON files with high precision.

The tool is relatively compact, about 200 lines of code, and handles different types of changes well, including additions, deletions, and type mismatches. However, I'm looking to improve how differences within arrays are displayed. Currently, if an item at the beginning of an array is modified or removed, all subsequent items are marked as changed, which isn't very helpful for quick analysis.

Here's where I could use your collective wisdom:

  1. Visualization Techniques: Does anyone have suggestions for more intuitive ways to display array differences? Maybe a method that effectively pinpoints and isolates changes without cascading the entire array?

  2. Code Feedback: I'd love to get some feedback on the implementation. I'm sure there are optimizations and best practices that I could apply to enhance the tool's performance and usability.

I'm looking forward to your insights and suggestions. Let's make JSON comparisons easier for everyone!

You can check out the tool and contribute here: https://github.com/phplego/jcmp

Thank you all in advance!

๐ŸŒ
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