ToolsWaves

JSON Compare

Compare two JSON objects side-by-side. Keys are normalized and sorted before diffing so structurally-identical JSON always compares equal — no false positives from key ordering. See exactly which keys were added, removed, or changed.

A
original.json
B
modified.json

About JSON Compare

JSON is the workhorse format for APIs, config, and structured data — and comparing two JSON payloads is one of the most common debugging tasks in a full-stack workflow. Was this API response different yesterday? Did my config change break something? Which fields moved between two versions of the same object? This JSON Compare tool answers those questions directly: paste two JSON objects, get a color-coded diff showing added, removed, and changed values, plus a structural summary listing each affected key path.

The tool normalizes both inputs before diffing — parses, sorts keys alphabetically, then pretty-prints — so two structurally-identical JSONs with different key ordering compare as equal instead of flagging every key as changed. Toggle off the sort if key order actually matters to your use case. The structural summary lists specific paths (address.postcode was added, roles[2] was added, age was changed) which is often more useful than reading the line diff for large payloads. Ideal for API response debugging, configuration change review, testing snapshot updates, and any scenario where JSON changes need human validation.

How to Use

1

Paste the first JSON in the left box and the second JSON in the right box.

2

Both are automatically pretty-printed. If either is invalid, an error appears with the exact position.

3

Toggle 'Sort keys alphabetically' — recommended on. When on, key order does not affect the diff, so {a:1,b:2} equals {b:2,a:1}.

4

The structural summary shows added, removed, and changed key paths (e.g. 'address.postcode' was added).

5

The line diff below shows the exact JSON-level differences with color coding — added lines green, removed lines red.

Frequently Asked Questions

Why does JSON Compare sort keys before diffing?

In JSON, key order carries no semantic meaning — {"a":1,"b":2} and {"b":2,"a":1} represent the same object. But a text-level diff sees them as different. Sorting keys before diffing eliminates this false-positive noise so you only see meaningful differences.

Does this handle nested objects and arrays?

Yes — the diff is recursive. Nested objects have their keys sorted at every level. Arrays are compared element-by-element (position-sensitive, since array order does carry meaning in JSON).

What if my two JSONs use different array orderings?

Arrays are compared positionally by default because [1,2,3] and [3,2,1] genuinely represent different data. If you want set-style comparison (order-independent), sort your arrays consistently before pasting.

Is my JSON uploaded anywhere?

No. The entire compare runs in your browser — parse, normalize, diff. Verify by opening the network tab: zero outbound traffic. Paste production API responses, tokens, and user records freely.

How is this different from a general text diff?

JSON Compare parses and normalizes both inputs before diffing, so it ignores whitespace, key ordering, and formatting differences. Text diff would flag those as changes. Use text diff when you need character-level accuracy; use JSON Compare when you only care about semantic differences.