Home/Tools/Developer Tools/JSON Compare

JSON Compare (JSON Diff)

Developer Tools
Left (original)
Right (changed)

Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy

What the JSON Compare does

JSON Compare shows the difference between two JSON documents as a list of paths: which keys were added, removed or changed, and where a value changed type. It compares the data, not the text, so reordered keys and different indentation are not reported as changes. A side-by-side view and a plain textual diff are one click away. It is for developers debugging API responses and config drift; it does not merge or edit the documents.

How to use it

  1. 1Paste the original JSON on the left and the changed version on the right.
  2. 2Keep Semantic selected to compare the data regardless of key order and whitespace, or choose Textual to compare the raw text line by line.
  3. 3Press Compare (or Cmd/Ctrl+Enter). Invalid JSON on either side is reported with its line and column.
  4. 4Read the list of changed paths, or switch to Side by side to see both documents normalized and aligned.
  5. 5Copy the report as text for a ticket, commit message or review comment.

Options explained

Semantic (ignore key order)
Parses both sides and walks the data. {"a":1,"b":2} equals {"b":2,"a":1}; 1.0 equals 1; formatting never matters. Use it for API payloads, config files and database exports.
Textual
Compares the two texts line by line, like a code review. Use it when the formatting itself is the question, for example to see what a formatter changed.
Sort keys
Before the side-by-side view is built, keys at every level are sorted so matching properties line up. Turn it off to keep the original order when the files are already consistent.
Changed paths / Side by side
The list is quickest for small sets of changes and for copying. Side by side is better for understanding a change in context, with unchanged runs collapsed by default.
Collapse unchanged
Hides long runs of identical lines in the side-by-side view, keeping two lines of context around each change.
Show type changes
A value that went from 9.99 to "9.99" is a type change, which is often the real bug. Hide the label when both sides deliberately differ in type.

Common problems and limits

Each side can be up to 10 MB. Both documents must be valid JSON for the semantic comparison; the textual mode works on any text.

Arrays are compared position by position. If an item was inserted at the start of a list, every following item is reported as changed, which is correct for ordered data but noisy for sets. Sort the arrays upstream if order does not matter.

Paths use JavaScript-style notation: $.user.address[0].city. Keys that are not valid identifiers are written as $["first name"].

The tool compares and reports; it does not produce a JSON Patch document or merge the two sides.

Very large documents with tens of thousands of changes render the full list, which can take a moment; the side-by-side view with collapsing is faster to read in that case.

Who uses it

  • API developers: Compare yesterday's and today's response for the same request and find the field that silently changed type.
  • DevOps and platform engineers: Diff two environment configs or Kubernetes manifests exported as JSON and list exactly which keys differ.
  • QA engineers: Check an expected fixture against an actual payload in a failing test without squinting at two formatted blobs.
  • Ecommerce integrators: See what a product or order webhook changed between two versions of a plugin before mapping it to a spreadsheet with the JSON to CSV converter.
  • Data analysts: Verify that two exports of the same record match after a migration, ignoring the key order different tools produce.

Frequently asked

Is there a JSON diff tool?

Yes: paste two documents above and press Compare. The semantic mode lists added, removed and changed keys by path and ignores key order and whitespace; the textual mode shows a classic line diff.

What is the best way to compare JSON files?

Compare the parsed data rather than the text, so that key order and indentation do not count as differences. That is what the semantic mode does. For a command-line equivalent, normalize both files with jq -S . and diff the results.

How do I find the differences between two JSON files?

Open both files, paste their contents into the two panels, and press Compare. The changed-paths list tells you which keys were added, removed or changed; Side by side shows the two documents aligned with the changes highlighted.

What is the difference between {} and [] in JSON?

{} is an object: an unordered set of key–value pairs, like {"id": 1}. [] is an array: an ordered list of values, like [1, 2, 3]. Objects are compared by key here; arrays are compared by position.

How do I compare two files for differences in general?

For plain text or code use the Text Compare tool, which works by line, word or character. For JSON use this page, because a text diff reports harmless key reordering as a change.

How can I compare two JSON objects in Java or JavaScript?

In JavaScript, JSON.stringify of both objects with sorted keys and a string comparison tells you if they are equal; libraries such as deep-diff or fast-deep-equal give the paths. In Java, Jackson's JsonNode.equals() compares trees, and JSONassert reports differences. Use this page when you need the answer without writing code.

Is there a better format than JSON?

It depends on the job. YAML is easier to write by hand, Protocol Buffers and MessagePack are smaller and faster, CSV suits flat tables. JSON remains the default for web APIs because every language parses it natively and it is readable.

Does the comparison send my data anywhere?

The comparison runs in your browser. As with the other text tools on this site, a copy of the run (both inputs and the report) is saved to your past runs so you can reopen it; see the Privacy page.

Automation: an MCP tool diff_json(a, b) → changes[] and an n8n node are planned for this tool.