About this tool
Compare two text blocks line-by-line, highlight added and removed lines, and export a unified diff.
A text diff tool compares two versions of a document line by line and reports exactly which lines were added, removed or left alone. This one computes the longest common subsequence with the Hunt-McIlroy dynamic program — the same idea behind diff(1) — so the edit script it produces is minimal, and it can export the result as a unified diff that `git apply` and `patch` both understand. It handles up to 2,000 lines per side and runs entirely in your browser.
Open Text Diff Tool on AltFTool — it loads instantly in your browser.
Paste your code or data sample into the workspace.
Pick the format, conversion, or analysis you need.
Copy the polished result straight back into your project.
The LCS algorithm reports the smallest set of changes, not a naive line-for-line mismatch.
Standard `--- / +++ / @@` output with a configurable number of context lines.
Optionally ignore letter case or collapse whitespace so real changes are not buried in reformatting.
It is the Dice coefficient over lines: twice the number of common lines divided by the total line count of both sides. Five lines against six with four in common scores 2×4 ÷ 11 = 72.7%. Two identical files score 100%, and two files sharing no lines score 0%.
The standard patch format: two header lines starting `---` and `+++`, then one or more hunks introduced by `@@ -start,count +start,count @@`. Removed lines are prefixed with `-`, added lines with `+`, and unchanged context with a space. Three context lines either side of each change is the conventional default, which is what this tool uses.
Line-level diffing treats a line as an indivisible unit, so any change inside it appears as one deletion plus one insertion. That is exactly how `diff -u` and `git diff` behave. Turn on 'ignore whitespace' if the only difference is indentation or spacing.
Yes — 2,000 lines per side. The LCS dynamic program allocates a table of (m+1)×(n+1) cells, so 2,000 by 2,000 is four million cells, roughly 16 MB. Beyond that a browser tab starts to stall, so the tool refuses rather than freezing.