JSON Diff Checker
Compare two JSON documents and instantly see which keys were added, removed, or changed, listed by key path. Objects and arrays are walked recursively, and even type mismatches are reported as changes. Everything runs in your browser — nothing is sent to a server.
What is a JSON diff checker?
A JSON diff checker compares two JSON documents structure by structure and instantly shows you which keys were added, which were removed, and which values changed. It shines in situations where a plain side-by-side read of the raw text simply carries too much information to process — an API response whose shape changed between releases, or a config file that differs from one environment to another. This tool walks objects and arrays recursively and reports differences at the key-path level, so you can pinpoint exactly where a value changed even inside deeply nested JSON.
For the comparison to work at all, both documents need to be structurally valid JSON. If either input has a syntax error — a missing comma, an unclosed quote, and so on — the tool reports which of A or B is invalid instead of attempting a diff. It is also worth understanding the two distinct matching rules this tool applies: object keys are matched by name, while array elements are matched by index (their order of appearance). Keeping this in mind helps you interpret why a particular key is flagged as "changed" rather than "added" or "removed."
How to compare JSON with the JSON diff checker
- Paste the source JSON (A) Paste or type JSON text into the first input box. You can copy an existing config file or API response as-is, without any reformatting.
- Paste the target JSON (B) Paste the "after" version, or the JSON from a different environment, into the second box. Which document you place in A versus B determines the direction reported for "added" and "removed" keys.
- Try the sample data (optional) Click "Load sample" to fill both boxes with an example that includes additions, removals, and changes, so you can see the output format right away.
- Read the diff results Removed, added, and changed keys are listed together with their key paths. For changed keys, the before and after values are shown side by side so you can read the difference at a glance.
- Clear the inputs when needed Use the "Clear" button to empty both boxes and start comparing a different pair of JSON documents.
Tips for getting more out of it
- Key paths are shown using dot/bracket notation like `user.address[0].city`, so you can immediately pinpoint which nested value changed, no matter how deeply the JSON is structured.
- Arrays are compared by matching elements at the same index. Note that simply reordering an array's elements will be detected as every element having changed.
- If the same key holds a string in one document and an object in the other, that type mismatch is also reported as a change, with both raw values shown side by side.
- When comparing API responses before and after a deploy, strip out fields that always change, such as timestamps or request IDs, so you can focus only on the differences that actually matter.
- Even for JSON with a huge number of unchanged values, only the count of matching leaf values is shown, keeping the result readable instead of overwhelming.
Use cases
Catching unintended API response changes
Save an API response before and after a backend deploy, then compare them here to catch unintended field additions, removals, or type changes early, before they reach production users.
Comparing config files across environments
Compare a staging and production config.json or package.json to spot missing environment variables or version mismatches that would otherwise be easy to overlook.
Explaining a diff during code review
When reviewing a JSON-based migration payload or schema definition, share the generated diff list directly instead of describing the changes verbally or in a long comment thread.
Debugging failing snapshot tests
Compare a JSON snapshot produced by an automated test against the expected value to quickly identify exactly which field caused the test to fail.
Validating third-party webhook payloads
Compare a real payload received from a webhook against a documented sample to confirm it actually matches the structure described in the API specification.
Glossary
- Key path
- A string that represents the route from the root of a JSON document down to a specific value, written in dot/bracket notation such as `user.address[0].city`. Diff results are grouped and displayed at this level.
- Nesting
- A structure in which an object or array contains further objects or arrays inside it. The deeper the nesting, the harder it becomes to spot changes by eye alone.
- Leaf value
- A terminal value in a JSON tree that does not branch any further — a string, number, boolean, or null. Ultimately, a diff comparison comes down to matching leaf values against each other.
- Type mismatch
- A situation where the value at the same key path is one data type (say, a string) in one document and a different type (say, an object) in the other. This tool reports type mismatches as changes as well.
- Syntax error
- Malformed text that causes JSON.parse to fail. A missing comma or an unclosed quotation mark are typical examples.
- JSONPath
- A query language specification for addressing values inside a JSON document. The key-path notation used in this tool is conceptually a simplified relative of JSONPath syntax.
Frequently Asked Questions
Side Note — How key matching differs between CSV diff and JSON diff
Our CSV diff checker compares rows and cells using a single designated key column to identify each row. JSON has no flat row-and-column structure — it allows nested objects and arrays — so even though both tools are called "diff checkers," the underlying matching algorithm is quite different. Instead of a key column, this tool uses a recursively built "key path" from the root down to each leaf as the unit of comparison.
Arrays are the trickiest part of diffing JSON. A CSV row can be uniquely identified by its key column value, but JSON array elements carry no guaranteed identifier. This tool simply matches elements by index (order of appearance), a design better suited to tracking changes in object structure or primitive values — as in config files or API responses — than to tracking additions and removals within an array's contents.
In practice, a similar idea appears in continuous integration pipelines that automatically check whether a REST API's response contract has changed. This tool favors the convenience of running entirely in the browser, but the underlying concept overlaps with snapshot testing and contract testing — mechanically detecting differences in JSON structure is a recurring challenge across many stages of software development.