3tej home

What is JSON Diff Checker?

A JSON Diff Checker computes json diff checker from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. Developers use it when debugging APIs and preparing data files.

JSON Diff Checker

Compare two JSON objects and see what changed - added, removed, or modified keys highlighted.

🔒 Browser-only ⚡ Instant 💸 Free forever 📡 Works offline 🚫 No signup
← Utilities

TLDR

Paste two JSON values separated by a line containing only `---`. The tool walks both trees and reports added paths (+), removed paths (-), and changed paths (~) along with old and new values.

Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

What a JSON diff is

A JSON diff compares two JSON values and reports exactly how they differ: which keys or array elements were added, which were removed, and which kept their path but changed value. Unlike a plain text diff, which compares files line by line, a JSON diff understands the structure of the data. It parses both inputs into real objects first, so differences in formatting, indentation, and key order are ignored. Two files that are byte-for-byte different but semantically identical produce zero reported changes.

This matters whenever JSON is the wire format. Developers reach for a structural diff to spot what changed between two API responses, to review a configuration change before deploying it, to debug why two environments behave differently, or to confirm that a data migration preserved every field. The tool above does this entirely in your browser: paste two values, separate them with a line containing only three dashes, and read the annotated list of changes.

How the comparison works

The tool parses each side with JSON.parse, then walks both trees in parallel, building a dotted path as it descends. At every node it applies a simple rule:

walk(a, b, path):
  if a === b: no change
  if leaf values differ:  ~ path: old -> new
  key only in b:          + path: value      (added)
  key only in a:          - path: value      (removed)
  both objects/arrays:    recurse into each key / index

Object keys are compared by name and are order-independent, while array elements are compared by position (index 0 against index 0, and so on). A path like tags[2] points at the third element of the tags array; a path like user.city points at a nested object key. The walk is linear in the size of the data, so even multi-megabyte payloads diff in milliseconds.

Worked example

Compare these two objects (the built-in Sample button loads them):

{"name":"Alice","age":30,"city":"SF","tags":["a","b"]}
---
{"name":"Alice","age":31,"city":"NYC","tags":["a","b","c"]}

The tool walks both trees and reports three changes. name matches and is silent. age changed, so it prints ~ age: 30 -> 31. city changed, giving ~ city: "SF" -> "NYC". The tags array matches at indices 0 and 1 but has an extra element at index 2 in the second input, so it prints + tags[2]: "c". The status line reads "3 difference(s) found." Reordering the keys in either object, or reformatting the whitespace, would not change this result.

How to read the output

SymbolMeaningExample line
+Path added in the second JSON+ tags[2]: "c"
-Path removed from the first JSON- meta.draft: true
~Value changed at the same path~ age: 30 -> 31
(none)No differences(no differences)

Common pitfalls

  • Missing the separator. The two values must be split by a line containing only three dashes. Without it the tool cannot tell where the first JSON ends.
  • Invalid JSON. Trailing commas, single quotes, or unquoted keys are not valid JSON and produce a parse error. Validate or format the input first.
  • Expecting smart array matching. Arrays diff by index, not by content, so inserting an element near the front can cascade into many reported changes even though only one item was added.
  • Treating number and string as equal. The value 5 and the string "5" are different types and will be flagged as a change.
  • Forgetting to copy. The result lives only in the browser tab; click Copy before navigating away, as nothing is saved.

Related tools

Frequently asked questions

How do I compare two JSON objects?

Paste the first JSON value, add a line containing only three dashes, then paste the second JSON value below it. Click Diff JSON and the tool walks both structures key by key and index by index, reporting every path that was added, removed, or changed along with the old and new values. Whitespace and key order do not matter because the tool parses both inputs into real objects before comparing, so two files that differ only in formatting show no differences.

What do the plus, minus, and tilde symbols mean?

A plus sign marks a path that exists in the second JSON but not the first, meaning a key or array element was added. A minus sign marks a path present in the first but missing in the second, meaning it was removed. A tilde marks a path that exists in both but whose value changed, and the tool prints the old value and the new value side by side so you can see exactly what differs.

Does key order or whitespace affect the JSON diff?

No. The tool parses both inputs with JSON.parse into native objects, then compares those objects structurally. Because object keys in JSON are unordered, reordering keys produces no diff, and reformatting, indentation, or trailing whitespace are ignored entirely. This is the key advantage over a plain text diff, which would flag every reordered line even when the data is identical.

How does it compare arrays in JSON?

Arrays are compared by index, so element 0 is matched against element 0, element 1 against element 1, and so on. If the arrays differ in length, the extra trailing elements show up as added or removed at their index path, written like items[2]. This index-based matching means inserting an element near the start of a long array can cascade into many reported changes, which is expected behavior for a positional comparison.

Is my JSON data sent to a server?

No. The entire diff runs in JavaScript on your device, so the JSON you paste never leaves the browser tab. Nothing is uploaded, logged, or stored, which makes the tool safe for API payloads, configuration files, or records that contain keys, tokens, or personal data. You can confirm this by opening developer tools and watching the Network tab: no requests fire when you run a diff.