Check out this python library jsondiff , that will help you to identify the diff's

import json

import jsondiff

json1 = json.loads(
    '{"isDynamic": false, "name": "", "value": "SID:<sid>", "description": "instance","argsOrder": 1,"isMultiSelect": false}')

json2 = json.loads(
    '{ "name": "", "value": "SID:<sid>","isDynamic": false, "description": "instance","argsOrder": 1,"isMultiSelect": false}')

res = jsondiff.diff(json1, json2)
if res:
    print("Diff found")
else:
    print("Same")
Answer from Jenish on Stack Overflow
๐ŸŒ
GitHub
github.com โ€บ xlwings โ€บ jsondiff
GitHub - xlwings/jsondiff: Diff JSON and JSON-like structures in Python ยท GitHub
>>> d = diff({'a': 1, 'delete': 2}, {'b': 3, 'delete': 4}) >>> d {'delete': 4, 'b': 3, delete: ['a']} >>> d[jd.delete] ['a'] >>> d['delete'] 4 # Alternatively, you can use marshal=True to get back strings with a leading $ >>> diff({'a': 1, 'delete': 2}, {'b': 3, 'delete': 4}, marshal=True) {'delete': 4, 'b': 3, '$delete': ['a']} ... jdiff [-h] [-p] [-s {compact,symmetric,explicit}] [-i INDENT] [-f {json,yaml}] first second positional arguments: first second optional arguments: -h, --help show this help message and exit -p, --patch -s {compact,symmetric,explicit}, --syntax {compact,symmetric,explicit} Diff syntax controls how differences are rendered (default: compact) -i INDENT, --indent INDENT Number of spaces to indent.
Author ย  xlwings
๐ŸŒ
Claude
code.claude.com โ€บ docs โ€บ en โ€บ headless
Run Claude Code programmatically - Claude Code Docs
session_id=$(claude -p "Start a review" --output-format json | jq -r '.session_id') claude -p "Continue that review" --resume "$session_id" Agent SDK quickstart: build your first agent with Python or TypeScript
Discussions

Adding a JSON diff tool to Clang's CI - Building Clang - LLVM Discussion Forums
Clang has a few different ways to output JSON, but our current model for testing the output is brittle and fairly unreadable (both in source and the output from FileCheck). Aaron Ballman and I have been chatting about using a dedicated tool such as jd, which can show the delta fairly well, ... More on discourse.llvm.org
๐ŸŒ discourse.llvm.org
1
April 24, 2023
Multilevel JSON diff in python - Stack Overflow
Please link me to answer if this has already been answered, my problem is i want to get diff of multilevel json which is unordered. More on stackoverflow.com
๐ŸŒ stackoverflow.com
Diff two large JSON array or objects
Yes Firstly you have to load json data in python dictionary using json module/package After that jsondiff module/package help you check different This module/package also compare list,set,etc.๐Ÿ‘Œ If will return empty dictionary {} if there is no different๐Ÿ‘ import jsondiff oldJson = {1:"a",2:"b",3:"c"} newJson = {1:1,4:4} r = jsondiff.diff(oldJson,newJson) if r : print(r) else: print("404,No Different Found!") Output: {1: 1, 4: 4, delete: [2, 3]} ๐Ÿ˜€ json.diff take 1st arg oldJson means from which we are checking different & 2nd newJson. There are 3 syntax ๐ŸŽฒ : compact ( default ) Any Change in Value of key & new insrted key will display normaly symmetric Inserted & delete show differently change show normally explicit ๐Ÿ‘€ It is detailed Inserted Deleted Changed Show differently import jsondiff oldJson = {1:"a",2:"b",3:"c"} newJson = {1:1,4:4} r = jsondiff.diff(oldJson,newJson,syntax="explicit") if r: print(r) else: print("404,No Different Found!") Output : {insert: {4: 4}, update: {1: 1}, delete: [2, 3]} ๐Ÿ˜ƒ Finally ๐Ÿ”ฅ,Now you doubt about how to access them You can access them using symbols eg. r[jsondiff.symbols.insert] OR from jsondiff import symbols r[symbols.insert] There are some other symbols which use in different compare like list,set, etc Note : if you try using insert in compact & update in compact & symmetric then you will get KeyError ๐Ÿ˜” because those not exist there import jsondiff from jsondiff import symbols oldJson = {1:"a",2:"b",3:"c"} newJson = {1:1,4:4} r = jsondiff.diff(oldJson,newJson,syntax="explicit") if r: print("Deleted keys are ",r[symbols.delete]) else: print("404,No Different Found!") Output : Deleted keys are [2, 3] ๐Ÿฅณ Thanks for reading ๐Ÿ˜‚ More on reddit.com
๐ŸŒ r/learnpython
3
3
February 26, 2022
Diff JSON and JSON-like structures in Python
It's actually more of a dictdiff :-) More on reddit.com
๐ŸŒ r/Python
5
5
July 4, 2016
๐ŸŒ
Code Beautify
codebeautify.org โ€บ python-formatter-beautifier
Python Formatter and Beautifier
Python data Try it. HealthInsurance: def __init__(self, name, founded): self.name = name self.founded = founded healthInsurance = HealthInsurance("UnitedHealth", 1977) print(healthInsurance.name) print(healthInsurance.founded) ... Buy us a Coffee JSON Formatter FAQ Privacy Policy Content Policy About Contact History Where am I right now?
๐ŸŒ
LLVM Discussion Forums
discourse.llvm.org โ€บ clang frontend โ€บ building clang
Adding a JSON diff tool to Clang's CI - Building Clang - LLVM Discussion Forums
April 24, 2023 - Clang has a few different ways to output JSON, but our current model for testing the output is brittle and fairly unreadable (both in source and the output from FileCheck). Aaron Ballman and I have been chatting about using a dedicated tool such as jd, which can show the delta fairly well, ...
๐ŸŒ
Terminusdb
terminusdb.org โ€บ docs โ€บ json-diff-and-patch
JSON Diff and Patch with TerminusDB
Use JSON Diff and Patch with a TerminusDB JavaScript or Python client to find and handle changes in TerminusDB schemas and documents, JSON schemas, and other document databases such as MongoDB.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-compare-json-objects-regardless-of-order-in-python
How to compare JSON objects regardless of order in Python? - GeeksforGeeks
July 23, 2025 - In this article, we will be learning about how can we compare JSON objects regardless of the order in which they exist in Python.
Find elsewhere
๐ŸŒ
PyPI
pypi.org โ€บ project โ€บ jsondiff โ€บ 2.0.0
jsondiff ยท PyPI
April 10, 2022 - Details for the file jsondiff-2.0.0-py3-none-any.whl.
      ยป pip install jsondiff
    
Published ย  Apr 10, 2022
Version ย  2.0.0
Top answer
1 of 3
21

Check out this python library jsondiff , that will help you to identify the diff's

import json

import jsondiff

json1 = json.loads(
    '{"isDynamic": false, "name": "", "value": "SID:<sid>", "description": "instance","argsOrder": 1,"isMultiSelect": false}')

json2 = json.loads(
    '{ "name": "", "value": "SID:<sid>","isDynamic": false, "description": "instance","argsOrder": 1,"isMultiSelect": false}')

res = jsondiff.diff(json1, json2)
if res:
    print("Diff found")
else:
    print("Same")
2 of 3
6

UPDATED: See https://eggachecat.github.io/jycm-json-diff-viewer/ for a live demo! Now it has a JS-native implementation.

Affiliation: I am the author of this lib.

Yes! You can diff it with jycm which has a rendering tool out of the box.

It uses LCS, Edit distance and Kuhnโ€“Munkres to diff arrays.

Here's an universal example with set in set and value changes in some set

from jycm.helper import make_ignore_order_func
from jycm.jycm import YouchamaJsonDiffer

left = {
    "set_in_set": [
        {
            "id": 1,
            "label": "label:1",
            "set": [
                1,
                5,
                3
            ]
        },
        {
            "id": 2,
            "label": "label:2",
            "set": [
                4,
                5,
                6
            ]
        }
    ]
}

right = {
    "set_in_set": [
        {
            "id": 2,
            "label": "label:2",
            "set": [
                6,
                5,
                4
            ]
        },
        {
            "id": 1,
            "label": "label:1111",
            "set": [
                3,
                2,
                1
            ]
        }
    ]
}

ycm = YouchamaJsonDiffer(left, right, ignore_order_func=make_ignore_order_func([
    "^set_in_set$",
    "^set_in_set->\\[\\d+\\]->set$"
]))

ycm.diff()

expected = {
    'list:add': [
        {'left': '__NON_EXIST__', 'right': 2, 'left_path': '', 'right_path': 'set_in_set->[1]->set->[1]'}
    ],
    'list:remove': [
        {'left': 5, 'right': '__NON_EXIST__', 'left_path': 'set_in_set->[0]->set->[1]', 'right_path': ''}
    ],
    'value_changes': [
        {'left': 'label:1', 'right': 'label:1111', 'left_path': 'set_in_set->[0]->label',
         'right_path': 'set_in_set->[1]->label', 'old': 'label:1', 'new': 'label:1111'}
    ]
}

assert ycm.to_dict(no_pairs=True) == expected

you can set no_pairs=False to get the all pairs. Here's a rendered example:

As for the example here, you can use it as:

from jycm.helper import make_ignore_order_func
from jycm.jycm import YouchamaJsonDiffer

left = {
    "data": [{"x": 1, "y": 2}, {"x": 3, "y": 4}]
}

right = {
    "data": [{"x": 3, "y": 4}, {"x": 1, "y": 2}]
}

ycm = YouchamaJsonDiffer(left, right, ignore_order_func=make_ignore_order_func([
    "^data",
]))

ycm.diff()

assert ycm.to_dict(no_pairs=True) == {}

Bonus, you the values are interrupted as coordinates on plain, you can even define a operator to determine whether two points should be matched!(Then comparing their values)

Here's the code:

from typing import Tuple

from jycm.helper import make_ignore_order_func
from jycm.jycm import YouchamaJsonDiffer
from jycm.operator import BaseOperator
import math

left = {
    "data": [
        {"x": 1, "y": 1},
        {"x": 10, "y": 10},
        {"x": 100, "y": 100}
    ]
}

right = {
    "data": [
        {"x": 150, "y": 150},
        {"x": 10, "y": 11},
        {"x": 2, "y": 3}
    ]
}


class L2DistanceOperator(BaseOperator):
    __operator_name__ = "operator:l2distance"
    __event__ = "operator:l2distance"

    def __init__(self, path_regex, distance_threshold):
        super().__init__(path_regex=path_regex)
        self.distance_threshold = distance_threshold

    def diff(self, level: 'TreeLevel', instance, drill: bool) -> Tuple[bool, float]:
        distance = math.sqrt(
            (level.left["x"] - level.right["x"]) ** 2 + (level.left["y"] - level.right["y"]) ** 2
        )
        info = {
            "distance": distance,
            "distance_threshold": self.distance_threshold,
            "pass": distance < self.distance_threshold
        }

        if not drill:
            instance.report(self.__event__, level, info)
            return False, 1 if info["pass"] else 0
        return True, 1 if info["pass"] else 0


ycm = YouchamaJsonDiffer(left, right, ignore_order_func=make_ignore_order_func([
    "^data$",
]), custom_operators=[
    L2DistanceOperator("^data->\\[.*\\]$", 10),
])

ycm.diff()

expected = {
    'just4vis:pairs': [
        {'left': 1, 'right': 2, 'left_path': 'data->[0]->x', 'right_path': 'data->[2]->x'},
        {'left': {'x': 1, 'y': 1}, 'right': {'x': 2, 'y': 3}, 'left_path': 'data->[0]',
         'right_path': 'data->[2]'},
        {'left': 1, 'right': 3, 'left_path': 'data->[0]->y', 'right_path': 'data->[2]->y'},
        {'left': {'x': 1, 'y': 1}, 'right': {'x': 2, 'y': 3}, 'left_path': 'data->[0]',
         'right_path': 'data->[2]'},
        {'left': {'x': 1, 'y': 1}, 'right': {'x': 2, 'y': 3}, 'left_path': 'data->[0]',
         'right_path': 'data->[2]'}
    ],
    'list:add': [
        {'left': '__NON_EXIST__', 'right': {'x': 150, 'y': 150}, 'left_path': '', 'right_path': 'data->[0]'}
    ],
    'list:remove': [
        {'left': {'x': 100, 'y': 100}, 'right': '__NON_EXIST__', 'left_path': 'data->[2]', 'right_path': ''}
    ],
    'operator:l2distance': [
        {'left': {'x': 1, 'y': 1}, 'right': {'x': 2, 'y': 3}, 'left_path': 'data->[0]',
         'right_path': 'data->[2]', 'distance': 2.23606797749979, 'distance_threshold': 10,
         'pass': True},
        {'left': {'x': 10, 'y': 10}, 'right': {'x': 10, 'y': 11}, 'left_path': 'data->[1]',
         'right_path': 'data->[1]', 'distance': 1.0, 'distance_threshold': 10,
         'pass': True}
    ],
    'value_changes': [
        {'left': 1, 'right': 2, 'left_path': 'data->[0]->x', 'right_path': 'data->[2]->x', 'old': 1, 'new': 2},
        {'left': 1, 'right': 3, 'left_path': 'data->[0]->y', 'right_path': 'data->[2]->y', 'old': 1, 'new': 3},
        {'left': 10, 'right': 11, 'left_path': 'data->[1]->y', 'right_path': 'data->[1]->y', 'old': 10, 'new': 11}
    ]
}
assert ycm.to_dict() == expected

As you can see jycm report addition and remove for points {'x': 150, 'y': 150} and {'x': 100, 'y': 100} for their distances are too far (more than 10) and value-change for the other two points.

P.S. RENDERER DEMO

๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-compare-json-objects-regardless-of-order-in-python
How to Compare JSON Objects Regardless of Order in Python?
In the above example, we utilized the json.loads method provided by Python's built?in json module to convert the JSON objects json_obj1 and json_obj2 to dictionaries. subsequently, we compared the two dictionaries using the == operator. ... The JSON objects are equal. The output of the code signifies that despite the elements of the two JSON objects being in different orders, they are equal.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ diff two large json array or objects
r/learnpython on Reddit: Diff two large JSON array or objects
February 26, 2022 -

I have a Python lambda function downloading a large excel file and converting it to JSON.

This file will be downloaded at least once a day (as the data can change)

I need to push the changed/updated data to an API.

Is there a way for me to compare two JSON files and output the diff?

It would be perfect if it would output multiple arrays of objects.

1 array of objects that have changed (I donโ€™t care what has changed, just need to know that it has)

1 array of removed/deleted objects.

Top answer
1 of 1
4
Yes Firstly you have to load json data in python dictionary using json module/package After that jsondiff module/package help you check different This module/package also compare list,set,etc.๐Ÿ‘Œ If will return empty dictionary {} if there is no different๐Ÿ‘ import jsondiff oldJson = {1:"a",2:"b",3:"c"} newJson = {1:1,4:4} r = jsondiff.diff(oldJson,newJson) if r : print(r) else: print("404,No Different Found!") Output: {1: 1, 4: 4, delete: [2, 3]} ๐Ÿ˜€ json.diff take 1st arg oldJson means from which we are checking different & 2nd newJson. There are 3 syntax ๐ŸŽฒ : compact ( default ) Any Change in Value of key & new insrted key will display normaly symmetric Inserted & delete show differently change show normally explicit ๐Ÿ‘€ It is detailed Inserted Deleted Changed Show differently import jsondiff oldJson = {1:"a",2:"b",3:"c"} newJson = {1:1,4:4} r = jsondiff.diff(oldJson,newJson,syntax="explicit") if r: print(r) else: print("404,No Different Found!") Output : {insert: {4: 4}, update: {1: 1}, delete: [2, 3]} ๐Ÿ˜ƒ Finally ๐Ÿ”ฅ,Now you doubt about how to access them You can access them using symbols eg. r[jsondiff.symbols.insert] OR from jsondiff import symbols r[symbols.insert] There are some other symbols which use in different compare like list,set, etc Note : if you try using insert in compact & update in compact & symmetric then you will get KeyError ๐Ÿ˜” because those not exist there import jsondiff from jsondiff import symbols oldJson = {1:"a",2:"b",3:"c"} newJson = {1:1,4:4} r = jsondiff.diff(oldJson,newJson,syntax="explicit") if r: print("Deleted keys are ",r[symbols.delete]) else: print("404,No Different Found!") Output : Deleted keys are [2, 3] ๐Ÿฅณ Thanks for reading ๐Ÿ˜‚
๐ŸŒ
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.
๐ŸŒ
Google
developers.google.com โ€บ gemini code assist โ€บ code with gemini code assist
Code with Gemini Code Assist | Google for Developers
January 9, 2026 - Code transformation allows you to use commands or natural language prompts in the Quick Pick menu to request modifications to your code, and provides you with a diff view to show pending changes to your code.
๐ŸŒ
JSON Compare
jsoncompare.org
JSON Compare - Best JSON Diff Tools
Online json compare tool is used to find json diff online. Input json code, json file compare, compare 2 json files, directly json url to compare & beautify.
๐ŸŒ
pre-commit
pre-commit.com
pre-commit
- id: check-json types: [file] # override `types: [json]` files: \.(json|myext)$ Files can also be matched by shebang. With types: python, an exe starting with #!/usr/bin/env python3 will also be matched.
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ configure โ€บ settings
User and workspace settings
November 3, 2021 - A setting shows up under this filter if its value differs from the default value, or if its value is explicitly set in the respective settings JSON file. This filter can be useful if you have forgotten whether you configured a setting, or if ...
๐ŸŒ
Packetcoders
packetcoders.io โ€บ diff-ing-the-network-jsondiff-part-2
Diff`ing the Network (jsondiff) - Part 2
November 22, 2021 - import jsondiff as jd deleted_arps_symmetric = arp_diff['interfaces'].get(jd.delete) rprint(deleted_arps_symmetric) === { 'Ethernet1/1': { 'ipv4': { 'neighbors': { '10.1.1.2': {'ip': '10.1.1.2', 'link_layer_address': '5000.0009.0000', 'physical_interface': 'Ethernet1/1', 'origin': 'dynamic', 'age': '00:00:09'} } } } } Now we have the details of our missing ARP entry as a Python dictionary, we can use it to perform further actions.
๐ŸŒ
pytz
pythonhosted.org โ€บ opslib โ€บ icsutils โ€บ jsondiff.html
IcsUtils.JsonDiff Common Library โ€” OpsLib Library alpha documentation
"members": { ... "role": "devops", ... "group": [ "devops" ] ... } ... } >>> json.dump(old_json, open("old.json", "w")) >>> json.dump(new_json, open("new.json", "w")) >>> fp_old = open("old.json", "r") >>> fp_new = open("new.json", "r") >>> engine = Comparator(fp_old, fp_new) >>> res = engine.compare_dicts() >>> print json.dumps(res, sort_keys=True, indent=4) { "members": { "group": { "0": { "+++": "devops", "---": "ops" }, "1": { "---": "devops" } }, "role": { "+++": "devops", "---": "ops" } }, "version": { "+++": "1.3.0", "---": "1.2.0" } }
๐ŸŒ
Medium
medium.com โ€บ @ssspidersilk โ€บ debugging-with-deepdiff-deep-differences-in-python-json-dicts-objects-51b5647d4ea9
Debugging with DeepDiff: Deep Differences in Python JSON, Dicts, & Objects | by Jerry | Medium
April 22, 2023 - As we can see, DeepDiff has identified the differences between the two lists of dictionaries, including changes in values. In this tutorial, we have explored some practical examples of using DeepDiff to simplify the debugging process in Python. By leveraging the power of DeepDiff, we can quickly and easily compare and analyze complex data structures, making it much easier to identify and fix issues in our code. Whether you are working with JSON ...
๐ŸŒ
DEV Community
dev.to โ€บ keploy โ€บ understanding-json-diff-tools-techniques-and-best-practices-582i
Understanding JSON Diff: Tools, Techniques, and Best Practices - DEV Community
January 22, 2025 - Developers often write scripts to automate JSON diff processes for greater control and flexibility. Here are some examples: Python: Using libraries like jsondiff, you can perform JSON comparisons with ease.
๐ŸŒ
PyPI
pypi.org โ€บ project โ€บ custom-json-diff
custom-json-diff ยท PyPI
Python :: 3.12 ยท Topic ยท File ... one reason or another. Enter custom-json-diff, which allows you to specify fields to ignore in the comparison and sorts all fields....
      ยป pip install custom-json-diff
    
Published ย  Mar 12, 2025
Version ย  2.1.6