JSON Compare & Diff

Paste two JSON documents and see exactly what changed: every added, removed and modified value, with its path.

Ctrl+Enter also works. Both documents are compared in your browser and never sent to a server.

Same Data or Not?

A text diff reports every changed character. A JSON diff should report changed data, and nothing else. Here is how this one decides:

OriginalChangedVerdictWhy
{"a": 1, "b": 2}{"b": 2, "a": 1}Same dataKey order means nothing in a JSON object.
19.9019.9Same dataOne number, two spellings. So are 1e2 and 100.
"caf\u00e9""café"Same dataAn escape sequence and the character it stands for.
1234567890123456789012345678901234567891DifferentThrough JavaScript's JSON.parse both become 12345678901234567000, and a diff built on it reports no change.
1"1"DifferentA number and a string are different values.

What You Can Do With It

Compare two API responses

Staging against production, before and after a deploy, version 1 against version 2: see which fields appeared, disappeared or changed value.

Review a config change

Package files, feature flags, translation files: paste the old and new version and read the change list instead of a noisy line diff.

Check a test fixture

When a snapshot test fails, compare the expected and actual JSON to find the one value that moved, with a path you can paste into the assertion.

Export the change as JSON Patch

Copy the RFC 6902 operations that turn the first document into the second, ready for fast-json-patch or any compliant library.

Checked by Applying the Patch

A diff can be wrong in two quiet ways: it can miss a change, or point at the wrong index after an insertion. To rule both out, this tool is tested on thousands of generated pairs of documents. For each pair, the JSON Patch it produces is applied to the first document by a separate implementation of RFC 6902, and the result has to equal the second document exactly. A missing change or a wrong position fails that test.

Both documents are read with the same parser as the JSON Formatter and the JSON Viewer, so an invalid file gets the same error, with its line and column and a link to the right JSON error guide.

Frequently Asked Questions

How do I compare two JSON files?
Paste the original on the left and the changed version on the right, then press Compare JSON. You get a list of every difference with its JSONPath, the old value and the new one, and you can filter it to only added, removed or changed values.
Does key order count as a difference?
No. A JSON object is an unordered set of names and values (RFC 8259), so two objects with the same keys and values in a different order hold the same data. Whitespace and indentation are ignored too.
How are arrays compared?
By default items are matched, like a text diff matches lines: if one item is inserted in the middle, you see one addition rather than every later item marked as changed. Choose Compare by position when the index itself matters, for example in a fixed-length tuple. Very large arrays with little in common fall back to position, and the result says when that happened.
How are numbers compared?
By exact decimal value. 1, 1.0 and 1e0 are equal; 0.1 and 0.10 are equal; 12345678901234567890 and 12345678901234567891 are different. Many tools read both files with JSON.parse first, which rounds every integer past 2^53, so two different IDs can come out identical and the difference is never shown.
What is the JSON Patch export?
A JSON Patch (RFC 6902) is a list of add, remove and replace operations that turns the first document into the second. Libraries such as fast-json-patch apply it, and it is a compact way to send or review a change. Each operation uses a JSON Pointer path, and numbers keep their exact written form.
What about duplicate keys?
If a document repeats a key, the last value is the one compared, which is what almost every JSON parser keeps. The JSON Formatter and the JSON Viewer show repeated keys if you want to find them.
Is my JSON uploaded?
No. Both documents are parsed and compared in your browser. Nothing is sent, logged or stored.

Related Tools