🔍

首页Home › 开发工具Developer Tools

🔗 JSON 合并工具JSON Merge Tool

把两个 JSON 深度合并成一个:嵌套对象逐层合并,冲突时可选以哪一方为准,数组可以替换、拼接、去重拼接或按位置合并。Deep-merge two JSON documents: nested objects merge level by level, you choose which side wins on conflicts, and arrays can be replaced, concatenated, de-duplicated or merged by index.

使用说明与常见问题How-to & FAQ

「JSON 合并工具」是什么?What is the JSON Merge Tool tool?

把两个 JSON 深度合并成一个:嵌套对象逐层合并,冲突时可选以哪一方为准,数组可以替换、拼接、去重拼接或按位置合并。Deep-merge two JSON documents: nested objects merge level by level, you choose which side wins on conflicts, and arrays can be replaced, concatenated, de-duplicated or merged by index.

如何使用「JSON 合并工具」?How do I use the JSON Merge Tool?

在第一个框粘贴 JSON A,在第二个框粘贴 JSON B,选择冲突规则和数组处理方式,下方实时显示合并结果。例如 {"a":{"x":1}} 与 {"a":{"y":2}} 合并为 {"a":{"x":1,"y":2}}。Paste JSON A in the first box and JSON B in the second, choose the conflict rule and array handling, and the merged result appears below. For example {"a":{"x":1}} + {"a":{"y":2}} gives {"a":{"x":1,"y":2}}.

冲突时以 A 为准是什么意思?What does "A wins" mean?

两边都有同一个键且值都是普通值(字符串、数字等)时,保留 A 的值;如果两边都是对象,仍会继续逐层合并,只在最底层的冲突上保留 A。When both sides have the same key with plain values (string, number…), A's value is kept; when both are objects they are still merged level by level and only the leaf conflicts keep A.

数组的四种合并方式有什么区别?How do the four array modes differ?

整体替换:用胜出一方的数组;拼接:A 的元素后接 B 的元素;拼接去重:拼接后去掉完全相同的元素;按位置合并:第 1 个和第 1 个合并、第 2 个和第 2 个合并,适合对象数组。Replace uses the winning side's array; Concatenate appends B's items after A's; Concatenate unique also drops exact duplicates; Merge by index merges item 1 with item 1, item 2 with item 2 — handy for arrays of objects.

「JSON 合并工具」免费吗?数据会上传吗?Is the JSON Merge Tool free? Is my data uploaded?

「JSON 合并工具」完全免费,无需注册或安装,手机和电脑都能用;所有处理都在你的浏览器本地完成,输入的内容和文件不会上传到服务器。The JSON Merge Tool is completely free with no sign-up or install and works on phones and desktops; everything runs locally in your browser and nothing you enter is uploaded.

相关工具Related tools

🆚 JSON 对比(差异比较)JSON Diff🧾 JSON 格式化校验JSON Formatter & Validator🔤 JSON 排序JSON Sorter平 展平 JSON 对象Flatten JSON Object🌲 JSON 可视化树形查看器JSON Tree Viewer🔀 YAML JSON 互转YAML to JSON Converter⚙️ .env 与 JSON 互转.env ↔ JSON Converter📐 JSON Schema 生成器JSON Schema Generator

← 全部工具All tools