JSON Tools Hubjsontoolshub.com

JSON Compare

Visual Diff

Compare two JSON documents, API responses, or configuration revisions to distinguish harmless object key reordering from real structural changes.

JSON Compare & Diff

Original JSON (Left)0 chars
Line 1, Col 1

JSON comparison and difference rules

JSON Compare parses your Original JSON (left) and Modified JSON (right), recursively sorts object property keys alphabetically before serializing both inputs cleanly, and highlights additions (+ green) and deletions (- red). Reordered object keys report as semantically equal, while reordered arrays ([1,2] vs [2,1]), nulls vs missing keys, and nested value changes appear clearly. Pre-parse checks warn if either payload contains unsafe integers above 2^53 - 1 or duplicate keys.

Features and output

  • Dual editor panes plus Diff View with green (+) added and red (-) removed line indicators
  • Ignores object key ordering automatically via recursive pre-diff key sorting
  • Preserves array element ordering and distinguishes missing properties from null values
  • Warns when duplicate keys or integers beyond MAX_SAFE_INTEGER affect parsed equality

When to use this tool

  • Compare actual vs expected API responses regardless of key serialization order
  • Audit configuration changes between staging and production deployments
  • Detect missing keys vs explicit null values during API regression testing

Practical example

Sample Input
A: {"a":1,"b":2}   B: {"b":2,"a":1}
Expected Output
Payloads are Semantically Equal (+0 added / -0 removed)

Array comparison stays order-sensitive ([1,2] vs [2,1] reports Differences Detected), and duplicate keys or integers above 2^53 - 1 display an explicit warning notice.

Common errors & troubleshooting

  • If either input contains invalid JSON syntax, comparison falls back to raw text line diffing and warns against semantic equality.
  • Reordered array elements intentionally flag as changes because JSON array order is meaningful.
  • Comparing two very similar large integers above 2^53 - 1 triggers a numeric precision caveat banner.

Limitations & edge cases

  • Arrays compare by element position rather than ignoring array order or matching objects by ID.
  • Does not export RFC 6902 JSON Patch arrays or support ignore-path glob rules.
  • Always redact API tokens before comparing production and staging responses.

Developer tip: If Diff View flags an unexpected line diff due to syntax failure on one side, verify both inputs individually in JSON Validator.

How to use JSON Compare

  1. 1Paste Original JSON on the left and Modified JSON in the right Modified JSON tab.
  2. 2Click Compare JSON (or press Cmd/Ctrl + Enter) to normalize and inspect differences.
  3. 3Review + added and - removed line counts in Diff View, or click Copy/Download to export the diff text.

Privacy note: Processing runs locally in your active browser tab. Avoid pasting live production secrets or tokens.Verified against implementation: November 2026

JSON Compare Reference

Frequently asked questions

Does object key order affect JSON Compare?

No. Because JSON objects are unordered name/value maps, JSON Compare sorts object keys recursively before diffing, so {"a":1,"b":2} matches {"b":2,"a":1} semantically.

Does array element order matter?

Yes. Array order is semantically significant in JSON, so [1, 2] vs [2, 1] is flagged as added/removed lines.

How are missing keys vs explicit null values handled?

Missing keys are absent from one normalized object while null values remain present ("key": null), so changing between omitted and null clearly highlights as a difference.

What happens with integers larger than Number.MAX_SAFE_INTEGER?

Standard JSON.parse rounds integers above 2^53 - 1, so our pre-parse hazard check emits a warning notice whenever large integers appear on either side so equality isn't misread.

Related tools and contextual links

View all 16 tools →
Check both JSON inputs for syntax errors →

Locate malformed syntax when diffing falls back to plain line mode.

Edit the JSON after reviewing differences →

Modify keys or fix discrepancies before re-comparing.

Format both payloads for manual review →

Normalize indentation and sort object keys independently.