diff-checker
A diff checker is a tool that compares two pieces of text and highlights every line that differs β additions in green, deletions in red, modifications in yellow. The ZTools Diff Checker uses a Myers-style longest-common-subsequence algorithm (the same algorithm git diff uses) to produce minimal, accurate diffs for files up to ~10 MB. The tool runs entirely in your browser; no text is uploaded. Use it for code reviews when you do not have git, contract redline comparisons, JSON or YAML config diffs, or any side-by-side text comparison.
Use casesβ
Reviewing changes in a piece of code outside gitβ
A colleague sends you "before" and "after" snippets in Slack. Paste both, see the diff at a glance, and make review comments without setting up a git repo. Especially useful when the code lives in a CMS, a no-code tool, or a configuration UI without version control.
Comparing two versions of a contract, policy, or legal documentβ
Lawyers, contract managers, and compliance teams often need to "redline" two versions of a document. Paste version A and version B, see every word change highlighted, and export the diff for a clean record of negotiated changes.
Diffing two JSON or YAML configuration filesβ
Two environments, two config files. Paste both side by side, spot the missing key or changed value instantly, and avoid the "works on my machine" debugging cycle. Combined with our JSON Formatter (to normalize first), this catches structural drift quickly.
Verifying a copy-paste was completeβ
When pasting a long block of text from one app to another (e.g. moving a SQL query between editors), paste both into the diff checker to confirm zero characters were lost in the transfer.
How it worksβ
- Paste original text on the left β Drag-drop a file works too. Empty lines, trailing whitespace, and tabs are all preserved.
- Paste new text on the right β Both panes accept arbitrarily long input β files up to ~10 MB diff in under a second on modern hardware.
- Click Compare β A Myers diff algorithm computes the minimal edit script and renders each line as added (green), removed (red), unchanged (gray), or modified (split-pane highlighting).
- Toggle view modes β Switch between side-by-side (best for code review) and inline (best for prose) views. Word-level diffing within changed lines makes prose changes easier to read.
- Adjust whitespace handling β Toggle "Ignore whitespace" or "Ignore case" to filter out cosmetic differences and focus on substantive changes.
Examplesβ
Input: Left: "Hello world" Right: "Hello there"
Output: Line 1: "Hello [-world-][+there+]" β one word changed
Input: Left: { "version": 1, "features": ["a", "b"] } Right: { "version": 2, "features": ["a", "b", "c"] }
Output: Line 1: version changed 1 β 2; features array gained "c"
Frequently asked questionsβ
Does the diff checker upload my text?
No. The comparison runs entirely in your browser using a JavaScript implementation of the Myers algorithm. Open DevTools β Network and confirm there are no requests during comparison.
How large a file can I diff?
Up to ~10 MB per side on a modern desktop browser without UI lag. For larger files, prefer git diff or delta from the command line.
Why does the tool show character-level changes within a line?
Within each modified line, a secondary word-level diff highlights the exact tokens that changed. Helps for prose where a single word differs in a paragraph.
Can I ignore whitespace differences?
Yes β toggle "Ignore whitespace" to treat lines that differ only in indentation or trailing spaces as identical. Toggle "Ignore case" for case-insensitive comparison.
Is this the same algorithm git uses?
Conceptually yes β both use Myers diff (or a fast variant like patience or histogram). For exact reproduction of git's output, use git diff directly.
Can I diff binary files?
No β this tool is text-only. For binary diffs use xxd | diff or specialized tools like vbindiff.
Tipsβ
- Format JSON or YAML before diffing to keep structural changes on separate lines.
- Use the "Ignore whitespace" toggle when comparing code reformatted by a linter.
- For prose comparison, the inline view is easier to read than side-by-side.
- Save the diff output as HTML if you need to share a redline with a non-developer.
Try it nowβ
The full diff-checker runs in your browser at https://ztools.zaions.com/diff-checker β no signup, no upload, no data leaves your device.
Last updated: 2026-05-05 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub