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.
Structural comparison, not a text diff
Two documents are compared as data. Object key order is ignored, so {"a":1,"b":2} and {"b":2,"a":1} are equal. Arrays are ordered: moving an item changes the result because position is part of the value. Number spellings that represent the same value, such as 1, 1.0 and 1e0, compare equal, while the string "1" remains different from the number.
Large integers and extreme exponents are compared exactly rather than through floating-point rounding. Duplicate keys are rejected because they make the document ambiguous. A missing key and a key whose value is null are different states and are reported separately.
Reading the change report
Each change is located with a JSON Pointer path, so /users/0/name identifies a nested value rather than a line number. This makes the report stable when formatting changes. The tool stops at 10,000 reported changes and enforces a 50-level nesting limit and a 1 MiB input limit per side.
Use JSON Viewer to explore one document and JSON Formatter to inspect syntax errors. Comparison answers whether two valid documents are equivalent; it does not decide which version is correct.
Processing and privacy
JSON Compare evaluates both documents locally; neither JSON value is sent to a comparison service. Input stays in browser memory until you reset or leave the page. Copy and download run only when you choose them. No tool input is sent to a processing service. Website pages and scripts still make ordinary hosting requests; the privacy policy separates those from tool processing.
A related inspection step
You can convert supported YAML to JSON before comparing when the next task needs that representation. Keep the original source and review conversion rules before comparing results.
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.
Does key order count as a difference?
No. Objects are compared by key and value; arrays are compared by position.
Does the compare ignore array order?
No. Array items are compared by index, so reordering an array is reported as a change.
How this tool was checked
JSON Compare was checked with object key order, equivalent number and string spellings, missing versus null values, large integers and differing primitive roots. See the testing method or report a failure.