JSON Diff

What Is JSON Diff?

Spotting what changed between two JSON payloads — an API response before and after, two config versions — is hard when formatting or key order differs. This free JSON Diff normalizes both sides (pretty-print + sorted keys) and shows a clear line-by-line comparison, so you see only the real changes, instantly in your browser.

JSON Diff compares two JSON documents and shows exactly what changed between them — which keys were added, removed or modified, and what their old and new values are. This is essential when debugging API changes across versions, reviewing configuration changes in code review, or tracking how a database record evolved over time. A visual diff is far easier to read than comparing two JSON blobs manually.

How to use it

  1. Paste the original JSON on the left.
  2. Paste the changed JSON on the right.
  3. Read the highlighted diff — green added, red removed.

Use Cases

  • Comparing an API response before and after a code change to verify only the intended fields changed.
  • Reviewing a configuration change between two environments (staging vs. production) in a readable format.
  • Tracking how a database record or document changed across two snapshots.
  • Debugging an unexpected API response by diffing it against the expected output.

How JSON Diffing Works

The tool first parses both inputs with JSON.parse() to validate they are valid JSON. Then it performs a deep structural comparison: for each key in both objects, it recursively checks whether the value is the same. If a key exists in only one document it is flagged as added or removed. If the key exists in both but the value differs, it is flagged as modified and both old and new values are shown.

Array diffing uses index-based comparison: position 0 in left is compared to position 0 in right. This means reordering an array will show all elements as changed even if the values themselves are the same. The tool is designed for comparing objects where structure matters, not for array-order-insensitive diffing.

Why use this tool

  • Ignores formatting and key-order noise.
  • Clear added/removed line highlighting and counts.
  • Runs in your browser — private and free.

Privacy

Comparison runs entirely in your browser. The JSON data you enter — which may contain API keys, credentials or business logic — is never sent to our servers.

FAQ

How does it compare the two?

Both inputs are pretty-printed with sorted keys, then compared line by line — so reformatting or key order alone never shows as a difference.

What do the colors mean?

Green lines were added in the changed JSON; red lines were removed from the original.

Is my data uploaded?

No. The comparison runs entirely in your browser.

Why does moving an item in an array show all elements as changed?

Array diffing is index-based: element at position 0 is compared to the element at position 0 in the other document. If you reorder items, every position may differ. For arrays that represent sets (order doesn't matter), you would need to sort both arrays before diffing, or use a specialised diffing algorithm — this tool prioritises simplicity and predictability.