JSON Diff
Compare two JSON payloads by object path, array index, and value.
What does JSON Diff do?
JSON Diff compares two JSON documents and highlights structural value changes.
- Primary use: JSON Diff compares two JSON documents and highlights structural value changes.
- Key technical fact: JSON objects are name/value collections, while arrays are ordered sequences, so object and array diffs must be interpreted differently.
- Practical check: Run the formatted or minified output through your parser, tests, or runtime when exact syntax behavior matters.
| Topic | Direct answer | Source |
|---|---|---|
| Direct answer | JSON Diff compares two JSON documents and highlights structural value changes. | IETF RFC 8259 |
| Key fact | JSON objects are name/value collections, while arrays are ordered sequences, so object and array diffs must be interpreted differently. | IETF RFC 8259 |
| Processing model | Runs locally in the browser; no production Node server receives the input. | Browser JavaScript |
Find structural changes between JSON payloads
JSON Diff compares two parsed JSON documents and reports differences at the exact path where they occur. Use it to review API response changes, config updates, test fixtures, feature flag payloads, and saved snapshots.
Objects are compared by key, while arrays are compared by index because array order is meaningful in JSON. Sorting object keys can reduce noise, but it does not make reordered arrays equivalent.
How to use
- Paste the original JSON into the left editor.
- Paste the changed JSON into the right editor.
- Choose whether to include unchanged paths or sort object keys before comparing.
- Click Compare JSON to generate the path-by-path structural diff.
What is JSON Diff?
JSON Diff is a browser-based comparison tool for structured JSON data. It identifies added keys, removed keys, changed primitive values, object changes, and array index differences.
Both sides must be valid JSON before comparison. The diff is structural rather than textual, so whitespace and object key order are not useful signals unless they affect the parsed data.
Input notes
Paste complete JSON documents on both sides. For line-oriented log entries, extract the JSON portion first. When arrays differ, check whether a shifted item caused many index-level changes.
Example
A changed value is reported at its JSONPath-style location:
Original
{"user":{"name":"Alice","role":"admin"}}
Changed
{"user":{"name":"Alice","role":"editor"}}
Diff
[changed] $.user.role
- "admin"
+ "editor"
MCP integration
MCP (Model Context Protocol) lets AI agents and apps discover and run Coding.Tools utilities for repeatable conversions, formatting, hashing, and generation workflows.
MCP tool name: json-diff
MCP endpoint: https://coding.tools/mcp
Call tools/list first. Each tool entry includes inputSchema, outputSchema, and examples so an AI agent or client can build valid arguments without guessing.
For tools/call, read result.content[0].text for the display value and result.structuredContent for machine parsing. Tool-level failures return isError: true; protocol failures return a JSON-RPC error.
Example tools/call request:
curl -s https://coding.tools/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"json-diff","arguments":{"input":"{\"user\":{\"name\":\"Alice\",\"role\":\"admin\"}}","options":{"compareTo":"{\"user\":{\"name\":\"Alice\",\"role\":\"editor\"}}"}}}}'
Most text and data tools accept an input string plus optional options. Browser-only image tools are listed for discovery and return a web UI link when they need browser image APIs.