JSON Difference Viewer
Compare two JSON documents and list added, removed, and changed values
JSON Difference Viewer — what it does
Compare two JSON documents and get a structured list of what was added, what was removed and which values changed, with the path to each difference. Comparing JSON as text is hopeless because key order and formatting vary; comparing it structurally tells you what actually differs.
When this tool helps
- Seeing what changed between two API responses captured before and after a deployment.
- Diffing configuration files across environments to find the setting that differs.
- Verifying that a data transformation changed only the fields it was supposed to.
How to use it
- Paste the first JSON document.
- Paste the second JSON document.
- Process the comparison.
- Review added, removed and changed entries, then download the result.
Accuracy, limits, and good practice
- Key order and indentation are ignored, so two documents that are formatted differently but structurally identical show no differences at all.
- Arrays are compared by position, so an inserted element early in a list marks everything after it as changed.
- An empty difference list is a real result: it proves two payloads are semantically identical despite any textual differences.
Frequently asked questions
Why does a text diff show changes when this does not?
Because text diffing sees reordered keys and whitespace as changes. Structural comparison looks only at meaning.
Can it handle deeply nested documents?
Yes, comparison recurses through the structure and reports the full path to each difference.
What about arrays of objects that were reordered?
Positional comparison reports those as changes. Sort both arrays by a stable key first for a meaningful diff.
Related tools on this site
- CSV File Difference — Compare two CSV files by a key column and export differences
- CSV Column Type Detector — Detect likely text, number, date, boolean, and empty column types
- Excel to JSON — Convert a selected worksheet into object arrays or row arrays
Everything above runs inside this page. JSON Difference Viewer needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
JSON 差異檢視器能做什麼
比較兩份 JSON 文件,得到結構化的清單:新增了什麼、移除了什麼、哪些值有變動,並附上每處差異的路徑。把 JSON 當文字比對毫無希望,因為鍵順序與排版都會變;用結構比較,才看得出真正的差異。
什麼時候用得上
- 查看部署前後擷取的兩份 API 回應之間有何變化。
- 比對不同環境的設定檔,找出差異的那一項設定。
- 驗證資料轉換只改動了預期中的欄位。
使用步驟
- 貼上第一份 JSON 文件。
- 貼上第二份 JSON 文件。
- 執行比較。
- 檢視新增、移除與變更項目,再下載結果。
精確度、限制與實務建議
- 鍵順序與縮排都會被忽略,因此排版不同但結構相同的兩份文件不會出現任何差異。
- 陣列依位置比較,早段插入一個元素會讓其後全部被標為變動。
- 「沒有差異」是有意義的結果:它證明兩份載荷在語意上完全相同,即使文字不同。
常見問題
為什麼文字比對有差異、這裡卻沒有?
因為文字比對會把鍵順序與空白視為變動;結構比較只看語意。
能處理很深的巢狀文件嗎?
可以,比較會遞迴走訪結構,並回報每處差異的完整路徑。
物件陣列被重新排序怎麼辦?
依位置比較會把它們全報成變動。請先依穩定鍵值排序兩邊陣列,比對才有意義。
本站相關工具
- CSV 檔案差異比較 — 依鍵值欄位比較兩個 CSV 並匯出差異
- CSV 欄位類型偵測 — 偵測文字、數字、日期、布林與空白欄位類型
- Excel 轉 JSON — 將指定工作表轉換為物件陣列或二維陣列
以上步驟全部在這個頁面內完成,JSON 差異檢視器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。