// DEV / JSON-DIFF
JSON 对比JSON Diff
递归比较两段 JSON,按路径列出新增、删除与修改的字段。Recursively compare two JSON documents and list added, removed and changed paths.
对象按 key、数组按下标比较,类型不同视为修改。Objects by key, arrays by index; a type change counts as modified.
两侧都为空。请分别粘贴要对比的 JSON。Both sides are empty. Paste the JSON to compare.
常见问题FAQ
JSON 对比是如何判断差异的?How does the JSON diff work?
递归比较两份 JSON:对象按 key 比较,与键的顺序无关;数组按下标比较;类型不同视为修改。新增、删除、修改会分别统计并列出路径。It walks both documents recursively. Objects compare by key regardless of order, arrays compare by index, and a type change counts as a modification. Additions, removals and changes are counted and listed with their paths.
两侧 JSON 有一侧格式错误怎么办?What if one side is not valid JSON?
会明确指出哪一侧语法有误并给出行列位置,不会展示不完整的对比结果。It names the invalid side with its line and column and shows no partial diff, so you never read a comparison built on broken input.
同类工具Related tools
- JSON 格式化JSON Formatter
- JSON 校验JSON Validator
- YAML / JSON 互转YAML ↔ JSON
- Base64 编解码Base64 Encode / Decode
- Unicode 编解码Unicode Encoder
- URL 编解码URL Encode / Decode
- URL 解析URL Parser
- 哈希生成Hash Generator
- 正则测试Regex Tester
- 密码强度检测Password Checker
- 随机密码Password Generator
- 颜色转换Color Converter
- User Agent 解析User Agent Parser
- UUID 生成UUID Generator
- 时间戳转换Timestamp Converter