JSON Diff

Compare two JSON documents side by side to identify added, removed, and changed values while ignoring object key order.

Ready. Paste two JSON payloads or click "Example" to compare.
0 B • 1 line
0 B • 1 line

Paste baseline JSON on the left and modified JSON on the right, then click Compare (Ctrl+Enter).

About the JSON Diff Tool

The API Toolkit JSON Diff tool performs a deep recursive comparison between two JSON payloads directly in your browser. It isolates structural and value differences using exact JSONPath notation (such as $.role or $.quota.requestsPerDay) without false positives from reordered object keys.

Comparison Rules

  • Key-Order Agnostic: Object properties are compared regardless of key ordering ({"a":1,"b":2} equals {"b":2,"a":1}).
  • Order-Sensitive Arrays: Array elements are compared index by index ($[0], $[1]).
  • Null vs. Omitted: Missing keys are distinguished from keys explicitly set to null.

Privacy & Security

  • Zero Server Uploads: Both JSON payloads remain strictly inside your browser memory.
  • XSS-Safe Output: All JSON paths and values are rendered as inert DOM text nodes via textContent.
  • 5 MB Safety Cap: Each editor accepts up to 5 MB to prevent browser tab freezes.

Frequently Asked Questions

Does key order matter when comparing two JSON objects?

No. According to the JSON specification, an object is an unordered collection of key/value pairs. Our JSON Diff tool normalizes and compares keys regardless of the order in which they appear in text.

How are missing keys compared against keys with a null value?

They are treated as distinct states. If Original JSON is {"id": 1} and Modified JSON is {"id": 1, "coupon": null}, the tool reports that $.coupon was Added with value null.

What happens if a JSON string contains HTML tags like <script>?

All output in the comparison report is inserted using safe DOM text properties (textContent), so HTML or JavaScript strings inside your JSON are displayed literally as plain text and can never execute.