Comparison Result

Comparison will appear here

Paste three or more JSON documents above and click Compare.

Features

Beyond pairwise diffing

Multi-document comparison

Compare three, four, five, or more JSON documents in a single view. Side-by-side layout makes it easy to spot which inputs differ on which keys.

Key union view

All keys across all documents are unioned into a single table. Missing keys are shown as a dash, so you can see at a glance which fields are present where.

Difference highlighting

Rows where values differ across inputs are visually highlighted. Quickly identify the keys that need attention without scanning every cell manually.

Add/remove inputs

Start with three inputs and add more as needed, or remove inputs you no longer care about. The layout adapts automatically to the number of active inputs.

Summary stats

See at a glance how many inputs are being compared, the total number of unique keys, the count of common keys (present in all inputs), and the count of differing keys.

CSV export

Export the comparison table as CSV for use in spreadsheets, reports, or version control. One row per key, one column per input. Easy to share and audit.

FAQ

Comparing multiple JSON — common questions

How does multi-document comparison work?

JSONLab parses each input independently and computes the union of all keys across every document. For each key in the union, the tool displays the value present in each input — or a dash if the key is missing from a particular input. Rows where values differ between inputs are highlighted in the comparison table.

Only objects are compared by key union. Arrays are compared by index in their own section, and primitive values (strings, numbers, booleans, null) are compared directly.

The summary panel shows the count of inputs, total unique keys, keys common to all inputs, and keys where values differ.

How are arrays handled?

Arrays are compared by index. If array A has 3 items and array B has 5, the extra items in B are shown as added. When comparing more than two documents, the union of all indices is used, and each cell shows the item at that index (or a dash if the array is shorter).

Comparison is structural, so values are compared by deep equality rather than by string representation. Two arrays with the same items in different orders will be reported as different.

If you need to compare arrays by a stable identifier rather than by index, pre-process your data to use objects keyed by ID, then compare the resulting objects.

Does key ordering matter?

No. JSONLab compares keys by name, not by their position in the document. Two objects with the same keys in different orders are considered identical, which matches the JSON specification's definition of object equality.

The comparison table is sorted alphabetically by key name for consistent display. This makes it easier to scan the table and find specific keys, especially when comparing large objects with many fields.

If key order matters to your use case (e.g., for a strict schema validation), use the JSON Diff tool with line-diff view, which is sensitive to textual order.

How many JSON documents can I compare?

There is no hard limit. You can start with 3 inputs and add as many as you need via the "Add input" button. Performance scales linearly with both the number of inputs and the size of each document.

For practical reasons, the comparison table is most readable with 3–6 inputs. Beyond that, the table may need horizontal scrolling on smaller screens, but the comparison itself remains accurate.

Each input is stored independently in localStorage, so your comparison setup persists across page reloads.

What are common use cases?

Developers use JSON Compare to diff API responses across environments (dev, staging, prod), compare configuration variants for different deployment targets, audit changes across API versions, and validate that data migrations preserve expected fields.

QA engineers use it to compare test fixtures before and after refactoring, ensuring that no fields are accidentally dropped or renamed. It's also useful for debugging — paste three failing API responses side by side to spot which fields differ.

For pairwise comparison of just two documents, the dedicated JSON Diff tool offers line-based and structural views that may be more convenient.