Home Tools Blog About

Diff Checker

In short

Side-by-side or unified text diff with word-level highlighting, ignore-whitespace/case toggles, .patch download. LCS-based. Free, offline, client-side, instant, secure.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up

Compare two text blocks with unified or side-by-side view, word-level highlighting within changed lines, and 3 normalization toggles (ignore whitespace / case / empty lines). A 5,000-line cap keeps it responsive, and the .patch download makes diffs usable in CI and code review.

🛡
100% PrivateNo server uploads, ever
InstantRuns in your browser
💧
No WatermarksClean output, always
🆓
Free ForeverNo accounts, no limits

How to Use Diff Checker

  1. Paste the original text in the left pane and the modified text in the right pane.
  2. Pick a view mode: Unified (default - single column with +/ prefixes) or Side-by-side (two columns with separate line numbers per side, easier for code review).
  3. Toggle normalization: ignore whitespace (collapse runs to single space), ignore case, ignore empty lines. Combine as needed for noise-suppressed comparison.
  4. For side-by-side, word-level highlighting shows which words changed inside an otherwise-similar line (default on).
  5. Press Ctrl+Enter to compare. Live preview updates after 300 ms.
  6. Stats card shows added/removed/unchanged line counts plus change ratio (% of lines that differ).
  7. Copy or download as .patch for paste into GitHub PR descriptions, git apply pipelines, or CI tools.

Frequently Asked Questions

Unified vs Side-by-side – when to use which?

Unified (default): single column, GitHub PR / git diff style. Lines marked + (added), (removed), or space (unchanged). Compact, easier to copy, faster to scan changes. Best for small diffs and code review.

What’s word-level highlighting?

When a line was changed (not purely added or removed), word-level highlighting splits the line by whitespace boundaries and computes a sub-diff. Removed words are struck-through in red on the left, added words shown in green on the right. Common in tools like GitHub PR review and Beyond Compare.

Why a 5,000-line cap?

The Wagner-Fischer LCS algorithm uses O(M×N) memory. For 5k×5k that’s 25 million Int32 cells = 100 MB – within reasonable browser limits. At 10k×10k: 400 MB, typically crashes. At 20k×20k: 1.6 GB, definitely crashes. For larger files use the Myers diff algorithm (O((M+N)·D) where D = diff size – typically much smaller), often via desktop tools like diff, delta, or git itself. This tool is for interactive review of human-scale text changes, not huge log files.

What’s the change ratio stat?

(added + removed) / total diff items × 100. Tells you “how different are these texts at a glance”. 0% = identical. 100% = nothing in common. Real-world examples: spelling-corrected article ≈ 1-5%, refactored function ≈ 20-40%, completely rewritten section ≈ 80%+. Useful for triaging “is this a small touch-up or a major change?” without reading the whole diff.

How does ignore-whitespace work?

For COMPARISON only: collapses runs of spaces/tabs to a single space, then trims leading/trailing whitespace. Two lines that differ only in indentation or trailing spaces will compare as equal. The original line content (with its original whitespace) is what gets DISPLAYED. So output preserves the original look even though comparison ignored the difference.

What does the .patch download contain?

Unified diff format – the same format used by git diff, git apply, GNU patch, GitHub PR descriptions. Three header lines (--- a, +++ b, @@ hunk header) followed by the diff lines with +//space prefixes. Can be applied with git apply diff.patch or piped to patch -p1. Useful for: GitHub PR descriptions (drop in a code block), CI pipeline file modifications, recording text changes for issue tracking.

How is this different from git diff?

Git diff: command-line, operates on files in a repository (knowing about HEAD, branches, the working tree). This tool: web-based, operates on text pasted into the browser, no repository concept. Output format is the same (unified diff). Use git diff for actual version-control workflows; use this for ad-hoc text comparison, or when you don’t have access to git, or when comparing snippets from different sources.

Why does my tab-vs-space diff show everything as different?

By default, tabs and spaces are different characters. A tab-indented line and a 4-space-indented line are entirely different. Turn on Ignore whitespace to treat them as equivalent (both collapse to one space). For code review where you specifically care about indent characters, leave it off.

Is my data secure?

Yes. All computation happens in your browser. Texts are not sent anywhere. The clipboard copy uses navigator.clipboard; the download is generated in-memory.

Keep going

Related Tools

All Developer tools →
Share

Embed this tool

Add this free tool to your website. Copy and paste the code: