0

JSON Diff With Sorted Keys — Ignore Key Order

Compare two JSON payloads by structure, not by text: see every added, removed and changed key on its own path, entirely in your browser.

Processing... 0%

Result

This page opens the JSON diff checker with 'sort keys before comparing' already turned on, loaded with a small example: the same person record written twice with its keys in a different order. Look at the result and you will see zero differences, exactly as it should be — reordering keys does not change what a JSON object means.

A JSON object is, by definition, an unordered collection of key/value pairs. {"id":1,"name":"Ada"} and {"name":"Ada","id":1} describe the exact same data. Yet a naive comparison — for instance pasting both payloads, pretty-printed, into a plain line-based text diff — will mark almost every line as changed the moment one side's serializer decided to emit fields in a different order, because a text diff only ever compares characters and lines, never meaning.

This tool avoids that trap by walking each object's keys by name rather than by position, so key order was never actually going to fool it — sorting just makes that guarantee visible and gives you a clean, alphabetically ordered list to read differences against. Edit either textarea and watch the diff update live; when you are ready, compare your own two JSON documents here instead of the example.