Paste two JSON documents to compare their structure — keys and value types — while ignoring the actual values. Ideal for checking whether two API responses share the same shape.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
What structure comparison tells you
Two JSON documents can hold completely different data yet still follow the same contract. This tool checks exactly that: it walks both documents together and reports every key that exists on only one side and every field whose type differs — a string id in one response against a numeric id in the other, for example. The values themselves never influence the result.
That makes it the right check when a value-level diff would drown you in noise: comparing responses from two API versions, validating that staging matches production, or checking a mock against the real endpoint.
Worked example
JSON A:
{ "id": 1, "user": { "name": "Asha", "email": "[email protected]" } }JSON B:
{ "id": "1", "user": { "name": "Ravi", "phone": "555-0100" } }Report — the name difference is correctly ignored, everything structural is caught:
✖ Structures differ — 3 difference(s) found.
Only in JSON A (1):
$.user.email
Only in JSON B (1):
$.user.phone
Type mismatches (1):
$.id — number in JSON A, string in JSON BWhen to use it
- Confirming that a new API version kept its response shape backward-compatible.
- Checking that a hand-written mock or fixture still matches the real endpoint.
- Comparing configuration files across environments where values are supposed to differ but fields are not.
- Reviewing whether two records in a collection follow the same schema before writing import code.
Limitations to know
- In the default array mode only the first element of each array is inspected; a malformed element deeper in a list only surfaces in “every index” mode.
- The report tells you shapes differ, not which side is “correct” — that judgement needs your API contract or schema. For contract-first validation, generate a schema with the JSON to JSON Schema converter instead.
- Both inputs must be valid JSON; a syntax error is reported with its line and column before any comparison runs.
Common errors and fixes
- “JSON A is not valid JSON (line X, column Y)” — the input has a syntax problem such as a trailing comma or single quotes; the message names the exact spot to fix.
- Everything reports as “only in A” — usually one document is wrapped in an extra container (like
{"data": {...}}) and the other is not; unwrap one side so the roots align. - Array differences not detected — switch the array option to “compare every index”; the default schema-style mode intentionally checks only the first element.
How to use the JSON Structure Compare
- Paste your first JSON document into the "JSON A" panel.
- Paste the second document into "JSON B".
- Choose how arrays are compared — first item only (schema-style) or every index.
- Click "Compare structures" to get a report of keys missing on either side and any type mismatches, each with its JSONPath.
Frequently asked questions
What does comparing JSON "structure" mean?
It compares the keys and value types of two documents while ignoring the actual values. Two API responses with the same fields and types match structurally even if every value differs — which is exactly what you want when checking that two responses follow the same contract.
How is this different from a normal JSON diff?
A value diff reports changed data, for example $.price changing from 9 to 10. Structure compare stays silent about values and only flags shape changes: keys that exist on one side only, and fields whose type switched (say, a string id in one document and a number id in the other).
How are arrays compared?
By default only the first element of each array is compared, which treats the array like a schema for homogeneous lists. Switch to "every index" mode to compare element by element — that mode also reports length differences as missing indexes.
Is my JSON uploaded to a server?
No. The comparison runs entirely in your browser with JavaScript; neither document is transmitted, logged or stored anywhere.