Both inputs are processed entirely in your browser — nothing is uploaded.
What is JSON Diff?
A JSON diff tool compares two JSON documents and highlights what changed between them: which properties were added, which were removed, and which values changed. Unlike a plain text diff (such as git diff) that treats every reformatted line as a change, a proper JSON diff is structure-aware — it understands that {"a":1,"b":2} and {"b":2,"a":1} represent the same object, and that pretty-printed and minified versions of the same payload are equal. This is critical when you're investigating API response changes, tracking configuration drift between environments, validating a feature-flag rollout, debugging why a unit test fixture suddenly breaks, or auditing what an external integration actually sends you. DevFormatLab's JSON Diff combines two views in one workspace. The text view is a familiar side-by-side red/green comparison built on top of an LCS algorithm — perfect when you want to copy a snippet or share a screenshot. The structural view distills the comparison into a clean list of paths (for example, $.user.email or $.items[3].price) with each change tagged as added, removed, or changed, and exports the difference as an RFC 6902 JSON Patch document that you can replay programmatically with any standard library. Object keys are sorted before comparison by default so property order never produces false positives, and an opt-in "ignore array order" mode normalizes unordered collections like tags or role IDs. Both inputs are parsed with the browser's native JSON.parse, compared in memory, and rendered locally — the page issues zero network requests once loaded, so even production secrets and customer payloads stay on your machine.
Features
- Side-by-side text view with red / green line highlighting
- Structural view: list of changed paths with add / remove / change tags
- RFC 6902 JSON Patch export — replay the diff with any standard library
- Optional key sorting so reordered properties are not flagged as diffs
- Optional ignore-array-order mode for unordered sets (tags, role IDs)
- Synchronized vertical and horizontal scrolling on both panes
- Strict JSON validation on both sides with separate error messages
- 100% browser-based — no JSON ever leaves your device
How to use
- Paste your original JSON into the left input panel and the modified JSON into the right. Pretty-printed or minified — both are fine; the tool re-formats internally before comparing.
- Keep "Sort keys" enabled (default) so the comparison is order-independent for object properties. Disable it only when the literal key order is part of the contract.
- For tags, permission lists, or other unordered collections, toggle "Ignore array order" — both arrays are deep-sorted before comparison.
- Read the colored side-by-side diff: red lines are removed, green lines are added, unchanged lines stay neutral. Use the synced scroll to navigate long documents.
- Switch to the structural view to see a compact list of changed paths and the live RFC 6902 patch. Click Export Patch to download patch.json.
- Use Swap to invert the comparison direction, or Format both to pretty-print both sides with 2-space indentation in place.
Frequently Asked Questions
Why do I see "Unexpected token o in JSON at position 1" when comparing?
▾
The literal string [object Object] was pasted instead of real JSON. This happens when you call console.log(obj) and copy the output, or string-concat an object. Always serialize first: // wrong console.log("payload=" + obj) // right console.log(JSON.stringify(obj, null, 2)) Paste the JSON.stringify output on each side and the diff will work.
Why are two identical-looking objects reported as different?
▾
Usually one of these: • Hidden whitespace or BOM at the start (a copied JSON file often begins with U+FEFF) • Trailing newline on one side only • Number vs. string: 1 ≠ "1" • Real value drift: null vs. "null", true vs. "true" Keep "Sort keys" enabled so property order does not produce false positives, and use the structural view to see the JSON Patch path of every real change.
How do I ignore array order (e.g. tags / permissions lists)?
▾
Toggle "Ignore array order" in the toolbar. Both arrays are normalized — each element is recursively deep-sorted by its JSON string representation before comparison. Use this for unordered sets like tags, role IDs or feature flags. Leave it OFF for ordered sequences like step lists or pagination results, where reordering really is a change.
How do I export the difference as a patch?
▾
Click Export Patch to download patch.json, an RFC 6902 JSON Patch document such as: [ { "op": "replace", "path": "/user/email", "value": "new@x.com" }, { "op": "add", "path": "/tags/-", "value": "beta" }, { "op": "remove", "path": "/legacy" } ] Apply it programmatically with any RFC 6902 library (e.g. fast-json-patch in JS, jsonpatch in Python).
How large can the inputs be?
▾
The LCS algorithm is O(n × m) on lines, so ~5,000 lines per side stays interactive; 50,000+ lines may freeze the tab briefly. Tips for big payloads: • Enable Sort keys so reorders do not balloon the diff • Use the structural view (path list) instead of text — it stays light even on huge inputs • Diff sub-trees: paste just response.data.items rather than the whole envelope
Is anything uploaded to a server?
▾
No. Both sides are parsed with JSON.parse, compared in-memory, and rendered to the DOM. Nothing leaves the browser tab. You can test by opening DevTools → Network: a successful diff produces zero new requests.
Related tools
Format, minify, validate and beautify JSON with inline error highlighting.
Remove duplicates, empty rows, trim whitespace, convert UTF-8 ↔ Shift-JIS.
Convert YAML ↔ JSON and YAML ↔ Java .properties with strict validation.
Encode and decode Base64 (and Base64URL) for text or files. Real-time, browser-only.
Encode and decode URLs, query strings and URI components with percent-encoding and form-style spaces.
Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes for text or files in your browser.
Convert Unix timestamps (seconds or milliseconds) to and from human-readable dates across timezones.
Decode JSON Web Tokens to inspect header, payload and signature, with readable timestamps and expiry status.
Test regular expressions in real time with match highlighting and presets.
Escape JSON into a string literal suitable for embedding into source code (double quotes and backslashes escaped).
Canonical: https://devformatlab.com/en/json-diff