API Response Diff Checker
Paste two JSON API responses and get a clean, highlighted diff. Instantly see what changed, what was added, and what was removed.
How this API JSON diff tool compares two responses key by key, not line by line
Most text diff tools compare JSON the way they compare any file: line against line. That breaks the moment a key gets reordered or a formatter reindents the file, because two functionally identical payloads suddenly look completely different. This tool skips that problem entirely. It parses both inputs as real JSON, flattens each one into a flat map of dotted paths, and compares those paths directly, so reordering keys or changing whitespace never produces a false difference.
Everything happens in your browser using JSON.parse and plain JavaScript object walks. There is no fetch, no XHR, and no server call anywhere in the script. Nothing you paste into either box leaves the tab.
The flatten and compare algorithm
Before any comparison happens, both responses go through the same flattening pass, turning nested structures into single level key paths that are easy to line up.
data.tags[2] is a real, comparable key rather than a nested structure.
JSON.stringify and compared as strings. That catches type differences too, since "42" and 42 stringify differently and are correctly flagged as changed.
Because comparison runs on flattened paths instead of raw structure, a field that moves from position three to position one in an object produces zero diff noise. Only paths whose actual value changed, appeared, or disappeared get flagged.
Two ways to read the output
The result renders in one of two layouts, both built from the same diff array so switching between them never reruns the comparison.
| Mode | Layout | Best for |
|---|---|---|
| Inline | Single column, unified diff style with + and – markers on separate lines | Scanning a long response top to bottom |
| Side by side | Two columns, response A on the left and response B on the right | Comparing structurally similar payloads field by field |
What each mode gives you
Format button
Runs both textareas through JSON.stringify(value, null, 2), pretty-printing minified API responses into readable two-space indented JSON before you even compare.
Download diff
Exports a plain-text file in a familiar unified diff header format, with a --- Response A and +++ Response B preamble, so it can be pasted into a bug report or pull request comment.
Swap and clear
Swap exchanges the contents of the two boxes instantly, useful for checking whether the diff reads the same in reverse. Clear resets both panes and the stat counters together.
Error handling before comparison
Each box is validated independently with its own try and catch around JSON.parse. If either side fails to parse, the tool reports the specific parse error message for that box and stops before running any comparison, rather than guessing at partial output.
Related standards and tools
- RFC 8259 defines the JSON data interchange format this tool parses and re-serializes.
- RFC 6902 JSON Patch defines a formal operation-based diff format (add, remove, replace) for JSON documents, useful if you need a machine-applicable patch rather than a human-readable report.
- RFC 7396 JSON Merge Patch describes a simpler merge-based alternative for describing changes to a JSON document.
- deep-diff is a Node library that performs a similar structural walk for programmatic use in test suites.
- JSONLint is worth bookmarking separately for validating malformed JSON before diffing it here.
When you actually need a structural diff
Comparing an API response before and after a backend deploy to catch unintended field changes, checking that a webhook payload matches its documented schema, reviewing what changed between two versions of a configuration object, verifying that a database migration did not silently drop a field, and debugging why two environments (staging versus production) return subtly different data for the same request.
FAQ: API Response Diff Checker
Any valid JSON — objects, arrays, nested structures, mixed types. The differ flattens nested keys into dot-notation paths so every value at every level gets compared.
No. All parsing and comparison runs entirely in your browser. No data leaves your machine, which makes it safe to use with production API responses containing sensitive payloads.
Green lines with a + were added in Response B. Red lines with a – exist in A but not B. Yellow lines with ~ had their value changed. Gray lines are identical in both responses.
Yes. Click Format JSON first and the tool pretty-prints both sides before comparing. This makes the diff much easier to read and removes false positives from whitespace differences.
Make the same API call against both environments (for example, staging and production), copy the JSON body from each response, paste them into Response A and B, and hit Compare. You will see every key that differs instantly.
From the blog
Deep dives on the things these tools touch
Minification, UUID collisions, diffing API responses, and the other questions that come up around this toolset.