Compare JSON structure and values
JSON Diff compares two valid JSON values and lists added, removed, value-changed and type-changed entries. Paste text or choose one UTF-8 file on each side, then select Compare JSON. Comparison runs in a cancellable browser worker. It is free, requires no account and does not upload or autosave your documents.
Use this JSON difference checker for API responses, configuration revisions and exported records. It ignores whitespace and object key order, compares arrays by index and keeps types significant. For differences between literal lines, including formatting, use Text Diff Checker.
How to compare two JSON documents
- Paste the earlier value into Before JSON and the later value into After JSON, or choose local UTF-8 files.
- Choose Exact decimal value or Exact number spelling. The rules below explain the difference.
- Select Compare JSON. Correct any syntax, duplicate-name, Unicode or resource errors in the identified side.
- Inspect the counts and individual paths. Filter by change type or a case-sensitive substring of the JSON Pointer path; use the page controls for more than 50 changes.
- Copy or download the comparison report if needed. Reports include both full input texts, the comparison rules, completion status and every recorded change, independently of the visible filters.
Swap sides changes the direction and clears the old result; compare again. Added and removed are relative to the selected direction. Editing either document or the number rules invalidates previous results and exports. Cancel stops pending work without clearing your inputs. Reset clears both inputs, results and filters, restores exact decimal mode and focuses Before JSON.
Know the comparison rules
| Data | Implemented comparison |
|---|---|
| Object members | Match decoded member names; ignore member order |
| Arrays | Compare the value at each index; order matters |
| Types | Keep strings, numbers, booleans, null, objects and arrays distinct |
| Strings and keys | Compare decoded text exactly, with case sensitivity and no Unicode normalization |
| Numbers, decimal mode | Compare exact decimal values without binary floating-point rounding |
| Numbers, spelling mode | Compare number tokens exactly, including zeros, decimal places and exponents |
| Missing members | Distinguish absence from a present JSON null |
All top-level JSON values are supported, including strings, numbers, booleans and null. Comments, trailing commas, single quotes, JSON Lines and JavaScript assignments are not standard JSON input for this tool. If a damaged document needs syntax repair, use JSON Repair, review the proposed data, then return to compare valid values. JSON Diff does not repair either source or select a value from duplicate keys.
Worked example: an API response changed
Select Load example. The inputs include:
{"request_id":9007199254740993,"status":"pending","total":1.2300,"tags":["new","priority"],"legacy":true}
{"tags":["new","reviewed"],"total":1.23,"status":"paid","request_id":9007199254740994,"note":null}
Exact decimal mode reports five changes: /legacy removed, /note added, and values changed at /request_id, /status and /tags/1. The nearby large IDs remain different. 1.2300 and 1.23 compare equal in this mode, and reordered object members add no changes. Switch to spelling mode and compare again to also report /total.
Counts describe comparison records. Adding a whole object or array produces one added-subtree record at its path, with the complete subtree in the report. Replacing an object with a string produces one type-change record. Counts are not a sum of every nested field affected.
Exact numbers without rounding large IDs
The comparison engine retains number tokens. Decimal mode derives an exact decimal identity from the sign, significant digits and exponent without converting the source number to a JavaScript Number or expanding a large exponent. It treats 1, 1.0 and 1e0 as equal; -0 and 0 also compare equal. It distinguishes 9007199254740993 from 9007199254740994, and 1e400 from 2e400.
Spelling mode also distinguishes -0 from 0, 1.00 from 1 and 1E+03 from 1000. It only changes number comparison: whitespace, object order and equivalent string escape spellings remain ignored. To compare every source character, use Text Diff Checker.
Reports keep JSON values in a json text field paired with their type. A large bare number is therefore represented inside a report string rather than rounded by report serialization. This is a comparison policy, not arbitrary-precision arithmetic or a promise about downstream software. A consumer that parses your original JSON as ordinary JavaScript numbers can still round it. Each exponent is limited to 1,000 digits in both modes.
Arrays compare by position
Select Array positions example to compare ["A","B","C"] with ["X","A","B","C"]. This tool reports changed values at /0, /1 and /2, followed by an addition at /3. It does not infer that an item moved or match records by an id field. A middle insertion can produce several positional differences.
Keep that rule in mind for API results whose sorting changed. JSON Diff has no unordered-array mode, record-identity matching or minimal edit-sequence guarantee. Reordering an array is a meaningful difference under its rules.
Read paths, types and missing values
Paths use JSON Pointer. The empty string "" identifies the document root; / identifies a member whose name is empty. A slash in a key becomes ~1, and a tilde becomes ~0. For example, key a/b has path /a~1b; key m~n has path /m~0n. The displayed path is quoted as a JSON string so control characters and backslashes are visible. This display is not a URL fragment or JSONPath expression.
Not present on this side means absence. A present null has type null and value text null. A number becoming a string is a type change even if both display the digits 123. Changing true to false is a value change, since both are booleans.
Equivalent JSON escapes are decoded for string and key comparison. Matching remains case-sensitive, and visually similar Unicode text can differ when its underlying sequences differ. Unpaired UTF-16 surrogates in raw or decoded text block comparison. Resolve duplicate decoded names within each object before comparing; the tool reports up to 20 locations per side and checks all occurrences.
Reports, filters and incomplete results
Copy report and Download report export the same versioned JSON comparison report. It includes both complete decoded input texts and the full values for recorded changes. Missing before/after values are represented by an absent-value marker, distinguished from { "type": "null", "json": "null" }. The report is not an RFC 6902 JSON Patch and cannot be applied to update another document.
Change filters and pagination affect only the on-page list. Values in that list show up to 2,000 UTF-16 code units each; the report retains complete values. All recorded paths remain in the report. Review a report before sharing it because it contains both originals, including unchanged private data.
A comparison stops if it exceeds 5,000 change records, a changed path exceeds 4,096 code units, or JSON-escaped recorded paths exceed a combined 1,048,576-code-unit budget. The result says Comparison incomplete and supplies a minimum change count. Category counts describe only listed records; the inputs must not be treated as equal. An export of this partial result is explicitly marked complete: false. Compare smaller sections to obtain a complete result.
Limits and failure recovery
| Limit | Behavior |
|---|---|
| Input text | 262,144 UTF-16 code units per side; oversized paste remains editable |
| Local files | One UTF-8 file per side, up to 1 MiB each; decoded text must meet the text limit |
| Parsed structure | 100 nesting levels and 100,000 JSON values per side |
| Number exponent | Up to 1,000 exponent digits per token |
| Change results | Up to 5,000 recorded changes, subject to the path budgets above |
| Visible results | 50 records per page; value previews up to 2,000 code units |
| Export | Up to 8,388,608 UTF-16 code units per report |
| Worker | Stopped after 10 seconds; both inputs retained |
UTF-16 code units are not UTF-8 file bytes or user-perceived characters. A typical emoji uses two code units. Invalid UTF-8 files are rejected rather than decoded with replacement characters, and the previous text is retained. A UTF-8 byte order mark is removed by the file decoder; pasted text is inspected as entered.
If a worker cannot start, crashes or times out, the tool clears pending results and preserves your inputs. Reduce size or nesting and retry in a modern browser with module-worker support. Cancelling, editing, swapping sides or resetting prevents an old worker reply from installing a stale result. Limits bound the workload; they do not promise a particular speed on every device.
Privacy and related validation
Inputs, imported file contents, member names, results and filters stay in current-tab memory. This tool does not upload or autosave them. Its interactive area is masked for session recording. Existing consent-aware analytics record fixed tool/action/example/result information, excluding private input, paths, filenames and report contents. Copies and downloads retain their data outside the tab, and Reset cannot remove those external copies.
A structural comparison does not validate an API contract or establish that either document is correct. Use JSON Schema Validator for required fields and types, JSONPath Tester to inspect selected values, or JSON Formatter to format valid source while retaining number text. Check each tool's privacy notes; autosave policies differ. Explore the Developer tools or the guide to formatting JSON without rounding large IDs for related workflows.
Technical sources
Technical behavior reviewed October 15, 2026: