Smart JSON Diff & Structural Comparison Tool

Compare two JSON objects side-by-side in real time with automatic validation, deep recursive structural diff, and formatting.

Comparing two JSON documents: how the diff is computed

The tool parses both JSON documents and walks them key by key: each path (for example settings.theme) is classed as added, removed, modified or type changed. Key order is ignored, but arrays are compared position by position.

The method

  • Each text is read with the browser's standard JSON parser. On a syntax error (trailing comma, single quotes, comment) the error message is shown and no comparison runs.
  • Objects are compared over the union of their keys: a key found only on the left is “removed”, only on the right “added”. Values present on both sides are compared recursively.
  • Two different simple values give “modified”; a number that became a string (1 and "1") gives “type changed”.
  • Arrays are treated as indexed objects: the path tags.3 means the 4th element.

Example

With the two sample documents the tool finds 7 differences: appName, version, settings.theme, settings.notifications and settings.maxItems modified (50 becomes 100), settings.cacheEnabled added and tags.3 ("ai") added. The unchanged key active is not listed.

Limits to know

  • Removing an item at the start of an array shifts every following one: ["a","b","c"] against ["b","c"] shows two modifications and one removal, not a single removal.
  • Numbers are read as doubles: above 9,007,199,254,740,991 two different integers may be judged equal. Compare long IDs as strings.
  • If a key appears twice in the same object, only the last value counts. 1.0 and 1 are treated as equal.
  • The format button re-indents both texts with 2 spaces; the comparison runs in your browser and nothing is sent.

Sources and dates: JSON is defined by RFC 8259 (December 2017), whose section 6 limits integer interoperability to the range ±(2⁵³ − 1) (checked 14/10/2026).

Frequently Asked Questions

Does key order matter in the comparison?

No. {"a":1,"b":2} and {"b":2,"a":1} are treated as identical because the tool matches keys by name. RFC 8259 also notes that member order in an object carries no guaranteed meaning.

Why does a reordered array show so many differences?

Arrays are compared position by position. If the first item is removed, every following item changes index: ["a","b","c"] against ["b","c"] gives two modifications and one removal.

What does “type changed” mean?

The same key holds values of different types on each side, for example the number 1 on the left and the string "1" on the right. This is a common source of bugs between an API and its client.

Why is my JSON rejected?

The tool applies strict JSON syntax: double quotes are required, no comma after the last item and no comments. The browser's error message usually gives the position of the faulty character.

Is this tool really free?

Yes, all tools on Kristools are 100% free and accessible without registration.

Is my data protected?

Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.