Yoryantra
← Back to Tools

JSON Diff Checker

Compare JSON structurally by path: ignore object member order and formatting whitespace, preserve array order, and report added, removed, changed, or type-changed values.

0 characters

0 characters

Comparison result

Structural differences will appear here...

The comparison stays local, but meaning still comes from the application

Both JSON documents are parsed and compared in the browser without being sent to a comparison API. Structural equality does not prove that two responses have the same permissions, timestamps, side effects, schema validity, or business meaning.

Compare the JSON values, not their indentation

A text diff notices spaces, line breaks, and reordered object members. A structural comparison first parses both documents and then follows the values. That means {"a":1,"b":2} and a pretty-printed object with b written before a compare as equal.

Arrays are different because position is part of their structure. Swapping two array items changes the values at those indexes. Paths are written as JSON Pointers from RFC 6901: /users/0/name identifies the name member in the first array item, while ~1 represents a slash inside a member name and ~0 represents a tilde.

Object order is ignored

{"name":"Sneha","age":30}
{"age":30,"name":"Sneha"}

The same member names point to the same values, so source order does not create a difference.

Array order is preserved

{"roles":["editor","viewer"]}
{"roles":["viewer","editor"]}

Both /roles/0 and /roles/1 change because the indexes are significant.

Read each difference as a statement about one path

ResultMeaning
AddedThe path exists only in the right document.
RemovedThe path exists only in the left document.
ChangedBoth sides have the same JSON type at that path but different values.
Type changedThe path moved between JSON types, such as number 1 and string "1".

Large numbers need more care than JavaScript Number provides

JSON number syntax is not limited to JavaScript's exact integer range. Converting every numeric token to IEEE-754 binary64 before comparing can make distinct large integers look equal. The parser keeps the original number token and normalizes its decimal value without passing it through JavaScript Number, so 9007199254740992 and 9007199254740993 remain distinct.

Spellings such as 1, 1.0, and 1e0 compare as the same numeric value. RFC 8259 defines the JSON number grammar and also explains the interoperability limits that appear when implementations restrict numeric range or precision.

Repeated object names make the result ambiguous

JSON syntax can contain the same member name more than once, but RFC 8259 says names should be unique because receiving software does not agree on what duplicates mean. Some implementations keep the last value, some report an error, and others expose every occurrence.

Repeated names are reported before comparison and the last occurrence is used for the structural tree. Treat that as a diagnostic convention, not as proof that another parser will make the same choice. A JSON Pointer aimed at a duplicated name is also not well-defined by RFC 6901.

Small differences that often explain API failures

Missing is different from null

{"middleName":null} explicitly contains a member. {} does not. Many APIs assign different meaning to those cases.

JSON types are not coerced

0, false, null, and "0" remain different. JavaScript truthiness is not applied.

Unicode normalization is not automatic

Two strings that look identical can contain different Unicode code-point sequences. String values are compared exactly after JSON escape decoding, without NFC/NFD normalization.

Unpaired surrogates deserve a warning

JSON's grammar can represent escapes such as \uDEAD, but RFC 8259 warns that lone UTF-16 surrogates can produce unpredictable behavior across software. Locations are reported without silently rewriting the string.

What a structural diff cannot tell you

Equal structure does not mean equal application behavior. Authorization, timestamps, omitted defaults, schema rules, side effects, and external state can matter even when two JSON documents match. Arrays are compared by index rather than by an id field, and objects are not treated as ordered records.

Browser work is intentionally bounded: nesting deeper than 200 levels is rejected, and comparison stops after 500 reported differences. Those limits prevent an accidental giant payload from turning the page into an unresponsive diff viewer.

When the next question is validity rather than difference

Syntax validation answers whether JSON can be parsed; JSON Schema answers whether a parsed value follows a contract. A diff answers neither of those questions—it only describes how two parsed values differ.