How to use
- Paste the original JSON into Original JSON and the new version into Changed JSON.
- Select Compare, or press Ctrl+Enter (⌘+Enter on Mac) in either box.
- Read the list: each line says what happened (Added, Removed, Changed or Type changed), where (a JSON Pointer path such as /users/0/email) and the old and new values.
- If an input is rejected, fix the reported line and column and compare again.
- Use Copy diff to copy the summary and the list as text.
Data, not text
JSON Semantic Diff compares JSON data, not text formatting. Two documents that hold the same data are reported as equal even when their indentation, line breaks or key order differ. To compare the text line by line instead, use Text Diff.
Only differences are listed; unchanged values are not shown. A difference is one of: Added (only in the changed document), Removed (only in the original), Changed (same type, different value) and Type changed (for example a number became a string, or an object became an array). When the type changes, the two values are shown as a whole instead of being compared inside.
Each difference has a JSON Pointer path (RFC 6901). The empty path, the whole document, is shown as (root). In key names, ~ is written as ~0 and / as ~1, so the key a/b appears as /a~1b.
When two values are equal
Object key order is ignored: {"a":1,"b":2} equals {"b":2,"a":1}. Array order matters: [1,2] and [2,1] are different.
Numbers are compared by their exact decimal value, without floating-point rounding. 1, 1.0 and 1e0 are equal, 1.50 equals 1.5, and -0 equals 0. Large integers are compared exactly: 9007199254740993 and 9007199254740992 are different, although JavaScript's JSON.parse reads them as the same number. Likewise 0.3 and 0.30000000000000004 are different.
Strings are compared character by character after escapes are resolved, so "\u00e9" equals "é". Unicode is not normalized: an é typed as one character and an e followed by a combining accent are different strings.
The values shown are copied from your input as you wrote them, with spaces and line breaks outside strings removed, so 1.0 stays 1.0 and long integers keep every digit. A value longer than 1,000 characters is cut off and the number of hidden characters is shown.
Arrays
Array items are aligned before they are compared, so inserting or removing one item is reported as one Added or Removed line instead of a change to every later item. Items that were edited in place are compared in depth, for example /items/2/price.
Indexes of removed items refer to the original document. Indexes of added items, and of items changed in place, refer to the changed document. A moved item is reported as removed from its old position and added at its new one: there is no option to ignore array order or to match items by a key.
Aligning very different arrays can take a long time, so alignment stops after 1,000,000 steps per array. That array is then compared by position (index 0 with index 0, and so on), and the page says so. An inserted or removed item in such an array can show up as a change to every later item.
Rejected input and limits
Both inputs must be strict JSON (RFC 8259): comments, trailing commas, single quotes and a leading byte order mark are rejected. An object that repeats a key is rejected, including keys that are only equal after escapes are resolved, such as "a" and "\u0061". Many JSON tools silently keep the last value instead; here the duplicate is reported with its line and column, because one of the values would otherwise be ignored without notice.
Each input is limited to 1,000,000 characters and to 128 levels of nested arrays and objects. At most the first 1,000 differences are shown; when there are more, the page says so.
Comparison runs in a background worker and is stopped after 5 seconds, so the page stays responsive. If your browser cannot start a worker, the tool shows an error instead of comparing on the page itself. Support has only been checked in Chromium-based browsers; Firefox and Safari are not verified.
FAQ
- Is my JSON uploaded?
- No. Your data is processed in your browser. Your JSON is not sent to a server, not stored, and not added to the page URL.
- Why does it say there are no differences when the texts are different?
- Because the data is the same. Indentation, line breaks, key order and how a value is written (1.0 or 1, \u00e9 or é) do not change the data. Use Text Diff if you need to see those text changes.
- Can it ignore array order or match array items by an id?
- No. Arrays are ordered in JSON, and this tool compares them that way. A moved item appears as removed and added.
- Can I export the result as a JSON Patch?
- No. The result is a readable list of differences, which you can copy as text.