Free Online JSON Comparer
Compare two JSON documents side by side, highlight the lines that differ, and debug API responses or configuration changes.
First JSON
Paste your original JSON or upload a file.
Second JSON
Upload or enter the JSON you want to compare.
About JSON Comparer
Compare JSON data and identify changes more efficiently.
How the comparison works
The comparer first parses each document with the browser's built-in
JSON.parse. If both are valid, they are re-formatted with the
same 2-space indentation so that differences in whitespace, tabs or line
breaks don't matter. The two formatted documents are then compared line
by line, and every line that differs is highlighted in both editors.
Finally, the tool tells you whether the two documents are identical.
Example: comparing two API responses
Say an endpoint returned this yesterday:
{
"id": 42,
"name": "Ada",
"roles": ["admin", "editor"],
"active": true
}
and this today:
{
"id": 42,
"name": "Ada",
"roles": ["editor"],
"active": false
}
The comparer highlights the roles lines and the
active line. Because the "admin" entry was
removed, the array is one line shorter and the lines after it shift up,
so they are highlighted too. In a line-based diff, an insertion or
deletion marks the lines that follow it as well.
Tips for accurate results
-
Key order matters.
{"a":1,"b":2}and{"b":2,"a":1}contain the same data but are reported as different. If your source doesn't guarantee key order, sort the keys first. -
Array order matters. In JSON,
[1, 2]and[2, 1]are different values, and the comparer treats them that way. -
Types matter.
"42"(a string) and42(a number) are different values. This is a common cause of bugs when a backend changes how it serializes IDs. - Remove noisy fields. Timestamps, request IDs and tokens change on every call. Delete them from both documents before comparing so that only meaningful changes are highlighted.
- Fix invalid JSON first. Trailing commas, single quotes and comments aren't valid JSON. Use the JSON Formatter to validate each document before comparing.
Common uses
- Checking what changed in an API response after a deployment.
- Comparing
appsettings.json,package.jsonor other configuration files between environments. - Verifying that a serializer change didn't alter the output.
- Reviewing test fixtures and expected-versus-actual results.
Frequently Asked Questions
It parses two JSON documents, re-formats both with the same 2-space indentation, and then compares them line by line. Lines that differ are highlighted in both editors, and a message tells you whether the two documents are identical.
Paste or upload the first document into the First JSON editor and the second into the Second JSON editor, then select "Compare JSONs". Use Clear to start a new comparison.
Yes. The comparison is order-sensitive, so {"a":1,"b":2} and {"b":2,"a":1} are reported as different even though they hold the same data. If order is not important to you, put the keys in the same order before comparing.
No. Both documents are parsed and re-formatted before they are compared, so differences in spacing, indentation or line breaks are ignored. Only differences in keys, values and structure are highlighted.
The comparison stops and the parser's error message is shown, so you can correct the document first. Common causes are trailing commas, single quotes and unquoted keys; the JSON Formatter can help you find and fix them.
No. Parsing and comparison run entirely in your browser with JavaScript. Your JSON is not sent to or stored on DevToolsWorld servers.
Yes. It is free to use and does not require an account or any installation.