Advertisement

JSON Diff Online 2026 - Compare Two JSON Objects Side-by-Side

Compare two JSON objects side-by-side. Identify differences in properties, arrays, and values with clear visual highlighting. 100% Private & Free.

Key Features

  • Side-by-side recursive diff
  • Visual difference highlighting
  • Smart array matching
  • Ignore key order option
  • Client-side only

How to Use

  1. Paste the original JSON in the left panel
  2. Paste the modified JSON in the right panel
  3. The tool automatically highlights differences
  4. Green indicates added content
  5. Red indicates removed content
  6. Yellow indicates changed values
  7. Use the "Sort Keys" option to normalize order before comparing
  8. Export or copy the diff report (if supported)

Expert FAQ

  • My arrays contain objects without a unique ID field — like a list of {name, value} pairs from an API response — how does the tool decide which elements to compare against which?
    By default, array elements are paired by position: index 0 in the left document against index 0 in the right, and so on. Without a stable identifier, that's the only pairing that doesn't require guessing — but it means inserting or removing an item anywhere except the very end shifts every element after it, producing a cascade of false "changed" results for objects that are actually identical, just shifted by one position. If your arrays do have a natural key (an id, sku, or email field), sort both arrays by that key before pasting them in, so insertions and deletions show up as isolated adds/removes instead of a wall of shifted diffs.
  • A large integer ID like 9007199254740993 shows as changed even though I didn't touch that field — why?
    JSON numbers are parsed as IEEE 754 double-precision floats in JavaScript, which can only represent integers exactly up to 2^53 (9007199254740992, i.e. Number.MAX_SAFE_INTEGER). Beyond that, two different-looking integers in your source text can parse to the identical rounded double, or one integer can silently round to a different value than what's in the raw text — so a diff on very large IDs (Snowflake IDs, 64-bit database keys) can either miss a real change or flag a non-change, depending on which side of the rounding boundary the values fall. If your data contains 64-bit IDs, keep them as quoted strings in your JSON rather than bare numbers, which sidesteps this entirely.
  • Can I compare two API request/response payloads that contain auth tokens or customer PII without that data being logged or sent anywhere?
    Yes — this is one of the most common real uses of a JSON diff tool (comparing a "before" and "after" API response while debugging), and both documents are parsed and diffed entirely in your browser's JavaScript engine. Neither the raw JSON nor the computed diff is transmitted to any server, so pasting in payloads containing bearer tokens, session data, or customer records doesn't expose them beyond your own machine.
  • Does it treat 1 and "1", or null and a missing key, as the same or different?
    Different, and intentionally so — type coercion in a diff tool hides real bugs. The number 1 and the string "1" are flagged as a value change even though they'd be == in loose JavaScript comparison, and an explicit "field": null is treated differently from the field being absent entirely, since many APIs distinguish "explicitly cleared" from "never set." If you need looser comparison for a specific field, normalize both inputs before pasting rather than relying on the diff to guess your intent.
  • I reordered an array without changing its contents — does that show as a diff?
    Yes, by default — arrays are compared by index/position, not by treating elements as an unordered set, because array order is frequently meaningful (a list of migration steps, an ordered config) and silently ignoring reordering would hide real changes for those cases. If your specific data is an unordered collection (a set of tags, for example), that's a property of your schema the tool can't infer automatically.

Technical Details

Diffing JSON requires more than text comparison because two semantically identical documents can be byte-for-byte different (reordered keys, different indentation, 1.0 vs 1). This tool parses both inputs into trees and walks them in parallel, comparing by key and value rather than by text position, so reformatting alone never produces a false-positive diff. A few comparison rules are deliberately strict rather than "smart," because loosening them hides real bugs: 1 (number) and "1" (string) are reported as changed even though some languages would coerce them as equal, since type drift between an old and new API response is exactly the kind of regression this tool exists to catch. Likewise, a key explicitly set to null is treated as different from the key being absent — many real APIs encode "explicitly cleared" differently from "never populated," and collapsing that distinction would lose information. Array comparison is position-based by default: element 0 in the left document is compared against element 0 in the right document. This is correct for ordered data (steps, ranked lists, anything where sequence matters) but means a reordered-but-otherwise-identical array shows as a diff — there's no general way to know whether a given array represents an ordered sequence or an unordered set without knowing your schema. For genuinely unordered collections, sort both arrays into a canonical order before pasting them in. Once you've reviewed a diff, the JSON Formatter is useful for getting either side into a clean, reviewable shape on its own.

Advertisement