JSON
JSON Diff / Compare
2つの JSON ドキュメントを比較 — 追加・削除・変更された内容を、各差分の正確なパスとともに表示。
Unlike a plain text diff, JSON Diff compares two documents by structure rather than by line: it understands that key order in an object doesn't matter, and it shows the exact path (e.g. user.address.city) to every difference.
How to use it
- Paste the original JSON into one field and the new version into the other.
- The result lists added, removed, and changed fields with the exact path to each and its old and new value.
- Formatting and key order don't affect the result — only the underlying data structure is compared.
Common uses
- Checking exactly what changed in an API response between two versions or two requests.
- Comparing configuration files (package.json, app settings) across branches or environments.
- Debugging a failing test by precisely comparing the expected and actual JSON output.
Things to keep in mind
Array elements are usually compared by position (index) — inserting one element near the start can show every following item as "changed", even though they merely shifted.
The comparison is structural, not textual — two JSON documents with identical data but different formatting or key order are treated as the same.
よくある質問
このJSON差分比較ツールは何ができますか?
2つのJSONドキュメントを比較し、追加・削除・変更された箇所を正確なパスとともに表示します。
配列の順序を入れ替えただけなのに「変更」と表示されるのはなぜですか?
配列の比較は基本的に位置(インデックス)ベースで行われるため、要素の内容が同じでも順序が変わると「移動」ではなく「変更」として検出されます。
比較する2つのJSONはサーバーに送信されますか?
されません。比較処理はすべてブラウザ内のJavaScriptで行われます。
オブジェクトのキーの順序は比較結果に影響しますか?
いいえ、構造比較はデータそのもの — フィールドの有無・値・型のみを見ます。JSONオブジェクト内のキーの順序は意味的に重要ではないため、結果には影響しません。
配列の要素を位置ではなく識別子で比較することはできますか?
具体的な比較アルゴリズムによります。シンプルなdiffツールは常にインデックスで配列要素を照合しますが、より高度なツールは id のような共通フィールドでオブジェクトを対応付けようとし、挿入や削除をより正確に示そうとします。