Free Online JSON Diff Tool
Compare two JSON documents instantly with our free JSON diff tool. Unlike text-based diff tools,
this tool performs a semantic diff — it understands JSON structure, so reordered
keys don't show up as false changes. Only real data differences appear in the output.
Features
- Semantic diff — compares JSON structure, not raw text; reordered object keys are not flagged as changes
- Auto-format — both inputs are prettified before comparison, normalising whitespace and key order
- Inline & side-by-side views — toggle between a unified diff view and two-column comparison
- Syntax-highlighted output — keys, strings, numbers, and booleans are colour-coded for readability
- Accessible diff colours — green/red backgrounds plus + and − symbols so colour-blind users can read the diff
- Copy as plain text — copies the diff with + / − prefixes, ready to paste into a ticket or document
- Real-time updates — diff runs automatically as you type with a short debounce
- 100% client-side — your JSON never leaves your browser; no server involved
- Array diff with LCS — uses longest-common-subsequence to find the minimal array diff, not just positional comparison
- Mobile responsive — inputs stack vertically on small screens
How to Use the JSON Diff Tool
- Paste the original JSON into the left (Original) panel
- Paste the modified JSON into the right (Modified) panel
- Diff updates automatically — or press Ctrl+Enter to also auto-format both inputs
- Read the output — green + lines are additions, red − lines are deletions
- Copy the diff with the Copy Diff button to paste it elsewhere
What is a Semantic JSON Diff?
A standard text diff compares files line by line. If you reformat a JSON file — adding spaces,
changing indentation, or reordering keys — a text diff will show hundreds of false changes.
A semantic JSON diff parses both inputs into data structures first, then compares the
data, not the text. The result: only real changes appear. Reordering {"a":1,"b":2}
to {"b":2,"a":1} shows zero differences, because the data is identical.
Frequently Asked Questions
Is my JSON data safe?
Yes. All comparison happens entirely in your browser using JavaScript.
Your JSON is never sent to any server. The tool works offline too.
Why does reordering object keys show no difference?
JSON objects are unordered by definition (per RFC 8259). This tool compares
the data semantically — if two objects have the same keys and values, they're identical regardless
of key order. That's correct JSON behaviour.
How does array diffing work?
Arrays are ordered, so position matters. This tool uses a longest-common-subsequence
(LCS) algorithm to find the minimal set of insertions and deletions — the same approach used by
git diff. For arrays larger than 500 elements, it falls back to positional comparison for performance.
What's the maximum JSON size?
There's no hard limit. The tool handles typical API responses and config files
(up to a few MB) smoothly. Very large files with deeply nested structures may take a moment to diff.
Can I compare JSON arrays at the top level?
Yes. Both inputs can be any valid JSON — object, array, string, number, or null.
The diff handles all cases.