Lintify Logo
Lintify
Validators & Formatters

JSON Diff — Compare Two JSON Files

Compare two JSON documents side by side and highlight every added, removed, or changed key. Great for diffing API responses between environments.

Left (original)
Right (new)
Differences
Paste two JSON documents to compare them.

Compare two JSON documents structurally

A plain text diff compares character by character. That works fine for prose, but it produces noisy results for JSON: reordering the keys in an object shows every line as changed, even though the data is logically identical. Lintify's JSON Diff parses both documents first and compares them by structure — every object is compared key by key, every array element by index. Reordering keys produces no false positives, and only the real changes are highlighted.

Each difference is shown with its full JSON Pointer path, so you can find the change in the original document. Paths likeusers.0.address.city tell you exactly which nested field changed, without having to scroll through the entire document side by side.

What JSON Diff catches that text diff misses

Beyond key reordering, structural diff catches several cases that text diff handles poorly. Two arrays with elements in different orders are highlighted element by element rather than as a single massive change. A field that was added on one side and a field that was removed on the other are reported separately, even if they happen to be at the same position. And numbers like 1 and 1.0 are correctly reported as equal because they represent the same JSON value.

Common use cases

The most common use case is comparing API responses between two environments — staging vs production, this build vs the previous build, or the response before and after a code change. Paste both responses into the tool and the diff shows you exactly what changed, no matter how the keys were ordered. Another common use is comparing two versions of a JSON config file after a merge, to verify that the merge produced the expected result.

For arrays specifically, remember that JSON arrays are ordered.[1,2,3] and [3,2,1] are different documents, and the diff will report every position as changed. If you want to compare arrays as unordered sets, sort both arrays by a stable key first (use the JSON Sorter tool) and then diff them.

Diffing very large documents

For documents with tens of thousands of nodes, the diff can take a second or two and the result panel can get unwieldy. If you only care about one section, narrow down the diff first by extracting that section with the JSON Path tool. Paste the extracted sections into the diff for a much smaller and faster comparison.

Frequently asked questions

Common questions about the Diff tool.

How is JSON Diff different from a text diff?
A plain text diff compares character by character, so reordering the keys in an object shows every line as changed. JSON Diff parses the structure first and compares values by key, which means reordering keys produces no false positives and only real changes are highlighted.
Does the order of array elements matter?
Yes. Arrays are ordered by definition, so [1,2,3] and [3,2,1] are different JSON. If you want to compare arrays as unordered sets, sort both arrays by a stable key before pasting them into the tool.
Can I compare JSON with different nesting depth?
Yes. Lintify walks both trees recursively and marks every path that exists on one side but not the other as added or removed. The output panel shows the full path (for example, users.0.address.city) so you know exactly where the change happened.
Why are numbers like 1 and 1.0 shown as equal?
In the JSON spec, 1 and 1.0 are both numbers and JavaScript represents them with the same Number type. If your use case treats integers and floats as distinct (for example a typed schema), use the JSON Schema Validator to enforce type rules.
Is there a limit on the size of the documents I can diff?
There is no hard limit, but very large documents (tens of thousands of nodes) can slow down the comparison and the rendering of the result. For huge files, narrow down the diff first by extracting the section you care about with the JSON Path tool.

Related tools