When to compare JSON
API upgrades, config releases, mock vs production payloads—eyeballing two blobs misses fields. ComTools JSON Compare (Tools/Json/Compare) uses dual panes, formats both sides, then diffs by object path with inline highlights.
Processing is local in the browser—nothing is uploaded.
Features
| Feature | Details |
|---|---|
| Dual editors | Independent A / B inputs |
| Format then compare | 2 / 4 spaces or Tab |
| Path-level diff | Detect added, removed, and changed values |
| Inline highlight | Colored marks on differing lines |
| Identical | Status shows documents are the same |
Steps
- Open JSON Compare.
- Paste JSON A (e.g. old response) on the left, B on the right.
- Choose indent (default 2 spaces).
- Click Compare.
- Read the diff count and jump to highlighted lines.
Use Sample for a quick demo (version 1→2 plus a new lang field).
Example
A
{
"name": "ComTools",
"version": 1,
"free": true
}
B
{
"name": "ComTools",
"version": 2,
"free": true,
"lang": "zh-CN"
}
Highlights call out the version change and lang addition.
Common scenarios
| Scenario | Approach |
|---|---|
| API regression | Old response A, new response B |
| Config release | Before / after paste |
| Validate first | JSON Validator on each side |
| Hard to read | Format then compare |
| Spreadsheet versions | Excel Compare |
Notes
- Both sides must be valid JSON; a parse error stops the diff.
- Comparison uses parsed data—whitespace-only differences often become “same” after format.
- Key order usually does not matter for value equality; watch paths and values.
- For huge payloads, trim to a subtree first.
Related tools
- JSON Formatter
- JSON Validator
- JSON Minify
- Text Diff — plain text, not JSON-aware
FAQ
Array reorder = diff?
Elements are compared by index; reordering often shows many changes. Sort first if you only care about set membership.
Floating point?
Exact JSON number values—no fuzzy tolerance.
Export a report?
UI highlights and counts today; screenshot or keep both originals for archives.