LazyTools

🔒 Every tool runs in your browser, the files and values you enter are never uploaded to any server. How it works

🔀 Text Diff & Compare

Paste two versions of any text and see exactly what changed, added, removed and unchanged lines, highlighted, with an exact line-by-line diff.

+2 · −1 · 2 unchanged
The quick brown fox
+The quick red fox
jumps over the lazy dog.
Line three stays.
+A new line at the end.

Exact line-by-line comparison via a longest-common-subsequence diff. 🔒 Both texts are compared entirely in your browser, nothing is uploaded, which matters for contracts, code and drafts.

Rate this tool:
Anonymous, no account, no identifier

How the text diff & compare works

The tool computes a longest-common-subsequence diff between the two texts, the same algorithm behind version-control diffs. It aligns matching lines, marks insertions in green and deletions in red, and counts the changes. Options let you ignore case and whitespace so trivial differences do not clutter the result. The LCS algorithm finds the longest sequence of lines common to both versions, then classifies every other line as an insertion or a deletion; because it optimises for the largest match, a moved or edited line shows as a deletion paired with a nearby insertion.

Sensitive by nature, contracts, code, and drafts are exactly what people compare, and pasting them into an online diff that uploads to a server is a real risk. This runs entirely on your device, and unlike asking a chatbot, the diff is exact rather than a summary.

Frequently asked questions

How does text comparison work?

It uses a longest-common-subsequence (LCS) diff, the classic algorithm that finds the minimal set of additions and deletions to turn one text into another, then aligns and colour-codes them. It is exact, not an approximation.

Can it ignore case or whitespace?

Yes, toggle “ignore case” and “ignore whitespace” to treat lines that differ only in capitalisation or spacing as unchanged, so you see only meaningful differences.

Is it better than asking an AI to compare?

For anything precise, yes. A chatbot summarises differences and can miss or invent changes; an LCS diff shows every changed line exactly, every time.

Does it do word-level diffs?

The main view is line-level, which is what most comparisons need. The underlying engine also supports word-level diffing within a line.

Why does a moved paragraph show as both removed and added?

A line-level LCS diff has no concept of "moved". It can only match lines in order, so a block that changed position appears as a deletion where it was and an insertion where it now is.

Does the order of the two texts matter?

The left text is treated as the original and the right as the revision, so additions and deletions are described relative to the left side. Swapping them swaps which lines count as added versus removed.

Is my text uploaded?

No, both texts are compared in your browser and never sent anywhere, which is important for contracts, code and private documents.

Related text tools