SmartJson.io

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

Updated October 9, 2026

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

What it does with tricky input

Each row is an automated test: the tool's own code runs on the input before every release, and the release stops if the result changes. Error text is what Chrome prints; Firefox and Safari word some errors differently. More on how we test.

CaseInputResult
A BOM from a Windows editor on one sideThe invisible byte-order mark is not a difference.InputLeft: [BOM]{"a":1}Right: {"a":1}Result
Content is identical.
Same data, keys in another orderInputLeft: {"a":1,"b":2}Right: {"b":2,"a":1}Result
JSON Objects are identical (structure and values).
Minified against pretty-printedInputLeft: {"a":[1,2]}Right: {\n "a": [1, 2]\n}Result
JSON Objects are identical (structure and values).
Two IDs past 2^53, one digit apartJavaScript rounds both to the same number; this compare does not.InputLeft: {"id":12345678901234567890}Right: {"id":12345678901234567891}Result
JSON Objects contain differences.

[id]: 12345678901234567890 !== 12345678901234567891
A string against a numberInputLeft: {"a":"1"}Right: {"a":1}Result
JSON Objects contain differences.

[a]: "1" !== 1
null against a missing keyInputLeft: {"a":null}Right: {}Result
JSON Objects contain differences.

[a]: null !== (missing)
Arrays in another orderArray order counts; key order does not.InputLeft: [1,2]Right: [2,1]Result
JSON Objects contain differences.

[0]: 1 !== 2
[1]: 2 !== 1
A change deep insideThe path says where.InputLeft: {"u":{"tags":["a","b"]}}Right: {"u":{"tags":["a","c"]}}Result
JSON Objects contain differences.

[u.tags.1]: "b" !== "c"

Key Features

  • ✅ Side-by-side recursive diff
  • ✅ Visual difference highlighting
  • ✅ Index-based array comparison
  • ✅ Key order ignored automatically
  • ✅ 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. Differing lines are highlighted red on the left and green on the right
  5. Object comparisons already ignore key order automatically — there is no separate Sort Keys toggle to use
  6. 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.

Try JSON Diff Online Now →

All Tools & Converters

JSON Tools

  • JSON Hub
  • JSON Formatter
  • JSON Validator
  • JSON Repair
  • JSON Error Messages
  • JSON Viewer
  • JSON Minify
  • JSON Stringify
  • JSON Sorter
  • JSON Compare
  • JSON to CSV
  • JSON to XML
  • JSON to YAML

XML Tools

  • XML Hub
  • XML Formatter
  • XML Validator
  • XML Compare
  • SOAP Formatter
  • WSDL Formatter
  • XML to JSON
  • XML to CSV

CSV Tools

  • CSV Hub
  • CSV Formatter
  • CSV Validator
  • CSV to JSON
  • CSV to XML
  • Compare Tools

    • JSON Compare
    • XML Compare
    • YAML Compare
    • CSV Compare
    • Text Compare

YAML Tools

  • YAML Hub
  • YAML Formatter
  • YAML Validator
  • YAML to JSON
  • Other Tools

    • Converters Hub
SmartJson.io

JSON, XML, CSV and YAML tools that run in your browser. Nothing you paste is uploaded.

Sitemap

Company

  • About Us
  • Contact
  • How We Test
  • Changelog
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • Disclaimer

© 2026 SmartJson.io. All rights reserved.

Report a problem with this page
Made withfor developers
1
0 chars | 1 lines

JSON Compare

Left
Right
1
0 chars