How to compare two JSON documents
- Paste the original document in Input A and the revised document in Input B.
- Select Compare JSON. Both documents must parse successfully before a comparison is produced.
- Read the change type and path in the preview table.
- Copy or download the full difference report. The preview displays at most 50 rows; the report includes every accepted change.
Use a stable before/after order. Reversing the inputs exchanges additions with removals and swaps the before and after values.
How structural JSON comparison works
Objects are compared by decoded key names, so indentation and member order do not produce differences. Strings compare decoded content, meaning "a" and "\u0061" are equal. Booleans, null and other types remain distinct. The number 1 is different from the string "1".
Numeric comparison normalizes decimal digits and the exponent exactly. Thus 1, 1.0 and 1e0 are equal, while adjacent integers above JavaScript’s safe-integer range remain distinguishable. Positive and negative zero compare equal. Before and after fields retain the original JSON spelling when a value changes.
Arrays compare by index, not as sets and not by an inferred identifier. Inserting an item at the beginning can therefore change several later positions. The tool does not guess that a row moved or merge documents automatically.
Reading added, removed and changed values
A JSON Pointer locates each difference. /users/0/name means the name member of the first users item. The empty path means the document root. Slashes and tildes inside keys are escaped as ~1 and ~0.
Adding or removing an entire branch produces one change for that branch. If both branches exist with matching container types, comparison descends to their children. A type change produces a change at that location. In the report, before/after values are JSON text strings; a null report field means there was no value on that side, while the string "null" represents an actual JSON null.
JSON diff example
Input
A: {"count":1,"name":"Ada"}
B: {"name":"Ada","count":2,"ready":true}Result
changed /count: 1 → 2 added /ready: absent → true
The reordered name key creates no difference. If only whitespace or equivalent decimal spelling changes, the report sets equal to true and returns an empty changes array. Use Text Diff instead when punctuation or textual layout itself is what you need to review.
Common comparison problems and limits
Each input is limited to 1 MiB and 50 nesting levels. Number tokens can contain up to 4,096 characters. More than 10,000 changes stops the operation rather than silently returning an incomplete report. Duplicate object keys, comments and trailing commas must be resolved before comparison.
This is a difference report, not an RFC 6902 JSON Patch document, schema validator or semantic explanation of an API change. It cannot determine whether a changed setting is safe. For a large response, compare the relevant branch after extracting it with a trusted editor. Use the JSON Viewer to explore its shape, or JSON Formatter to diagnose syntax first.
Processing and privacy
The operation runs in your browser. The tool does not send the material you enter to a processing server or automatically save it. Reset clears the form and result from the interface; it is not a secure-erasure guarantee for browser memory. Copy and download deliberately create copies outside the tool. The website itself still makes ordinary requests for its pages and scripts. See the privacy policy for the distinction.
Frequently asked questions
Will reordered keys be reported?
Object member order is ignored. Array order remains significant because array elements are compared by index.
Are 1 and 1.0 treated as different values?
No. Exact decimal normalization treats equivalent number spellings as equal without converting them to floating-point numbers.
Can I apply the downloaded report as a patch?
No. It is an inspection report with before/after JSON text, not an executable JSON Patch.