Skip to content

JSON diff tool

Compare two JSON documents and find the keys and values that actually changed. Format both sides to remove indentation noise, or sort keys so that reordered-but-equivalent objects compare as identical. Nothing is uploaded — useful when the payload contains tokens or customer data.

1 line0 words · 0 chars
1 line0 words · 0 chars

Add text to both panels to see the differences appear here.

Getting a clean JSON comparison

Raw JSON rarely diffs cleanly. One side comes back minified from an API, the other has been pretty-printed by an editor, and a naive comparison reports that every line differs. Two actions fix almost every case.

Format first

Format parses and re-serialises both documents with two-space indentation. Once both sides share a layout, the remaining differences are real ones. If a panel does not contain valid JSON, you are told which side failed rather than having it quietly mangled.

Sort keys when order varies

JSON objects have no defined key order, so two servers can emit the same object with keys in different positions. Sort keys recursively alphabetises every object key on both sides. Arrays keep their original order, because there the order is part of the data.

Reading the result

Character precision is the default, so within a changed line the specific value that moved is highlighted rather than the whole property. That makes a version bump or a flipped boolean obvious at a glance.

JSON comparison questions

How do I compare two JSON files online?

Paste one JSON document into each panel and select Format. Both sides are re-serialised with consistent indentation so that formatting differences disappear, then compared line by line with the changed values highlighted. Invalid JSON is reported rather than silently reformatted.

Why do two identical JSON objects show as different?

Usually because of formatting or key order rather than content. Minified JSON on one side and indented JSON on the other produces differences on every line; select Format to normalise both. If the same keys appear in a different order, select Sort keys, which recursively alphabetises object keys so only genuine value changes remain.

Does sorting keys also reorder arrays?

No, and that is deliberate. Object keys are unordered in JSON, so alphabetising them is safe. Array order is meaningful data, so arrays are left exactly as they are. If you need to compare arrays whose order varies, turn on 'Sort lines before comparing' in the settings after formatting.

Can I compare two API responses?

Yes, this is one of the most common uses. Paste the response from each environment or each run, format both, and the diff isolates the fields that changed. Because the comparison is local to your browser, response bodies containing tokens or customer data are not exposed to a third party.

Is there a size limit for JSON comparison?

There is no imposed limit; the practical ceiling is your device's memory since everything runs locally. Documents of several thousand lines compare in milliseconds, and unchanged regions are collapsed so large payloads stay navigable.