Data Diff

Compare JSON structurally (added / removed / changed paths) or any text line by line, right in your browser

Runs locally

Original

Modified

Diff Result

Enter text on both sides — the differences appear automatically

Tips

  • JSON mode compares data structurally: key order and formatting differences are ignored, only real value changes are reported.
  • Text mode compares line by line: green lines were added, red lines were removed, gray lines are unchanged.
  • added   removed   changed
  • Use Swap to reverse the direction — additions become removals and vice versa.
  • Ctrl/Cmd + Enter compares from either input.

Two diff modes, picked automatically

Data Diff starts from whatever you paste. When both sides parse as JSON it switches to a structural diff; for everything else it compares line by line. You can also lock a mode manually with the tabs above the result.

What the JSON structural diff reports

  • Added — a key or index that exists only on the modified side, with a preview of its value.
  • Removed — a key or index that exists only on the original side.
  • Changed — the same path holds a different value on each side, shown as before → after.
  • Type changed — the path holds an object on one side and a scalar or array on the other.
  • Every entry carries a path in the same $.store.books[0].title notation used by the JSON, XML and YAML Inspectors, so you can jump straight to it in the source.

Text diff, when you need it

Line-based comparison highlights every added and removed line with line numbers. It works on code, logs, config files, and any text — including JSON whose formatting changed but whose data did not.

Example: what JSON mode sees that text mode does not

The two snippets below differ only in key order and indentation. Text diff reports almost every line as changed; JSON structural diff correctly reports zero changes.

A
{
  "name": "web",
  "version": "1.0"
}
B
{
  "version": "1.0",
  "name": "web"
}

Where this fits in your workflow

Data Diff is the compare step of the workbench. Send any document here from the other tools:

Frequently Asked Questions

Common questions about Diff Formatter formatting answered

Yes, our diff formatter is completely free with no registration required. All processing happens in your browser.

You can compare any text content: code, configuration files, JSON, XML, plain text, or any other text-based format.

The JSON diff parses both sides and compares the data structurally, so reordered keys and different formatting are not reported as changes. The text diff compares raw lines, which makes it the right choice for code and logs.

Yes. Click the swap button to reverse the original and modified texts, turning additions into removals and vice versa.

The tool uses the Myers diff algorithm, which is the same algorithm used by Git for text comparison, ensuring accurate and minimal diffs.

The unified diff format (-u), as produced by git diff, diff -u, and every major version control system - one or more file sections, each with ---/+++ headers, @@ hunk markers, and +/- /context lines. GNU diffutils documents the exact format; the formatter re-wraps hunks with aligned line numbers and syntax coloring.

@@ -3,7 +3,8 @@ says: in the old file, starting at line 3, 7 lines are shown; in the new file, the corresponding section starts at line 3 and spans 8 lines. Reading the counts tells you the change size at a glance - here one line was added. The formatter keeps these markers intact because patch(1) and git apply depend on them.

No - it formats and explains patches, it does not apply them. For applying, use git apply or patch -p1; for merging conflicting hunks, your VCS's merge tool. Formatting is deliberately read-only so you can safely paste any patch, including ones with rejected or conflicted hunks, for readable review.

Yes. Your input is kept as a local draft in your browser, so an accidental refresh or a closed tab will not lose your work — it is restored when you come back to the tool. Clearing the input erases the draft immediately, and nothing ever leaves your device. Passwords, API keys, .env files and tokens are never saved.

Essential tools for developers and programmers to format, validate, and manipulate code