Text Diff

Free online text diff tool: paste two blocks of text and instantly see what was added, deleted, or kept the same, line by line. Shows addition and deletion counts and a clean side-by-side change list. Runs entirely in your browser.

Paste both texts, then press Compare.

How text diff works

A diff compares two versions of text and shows exactly what changed between them. This tool works line by line: it matches up the lines that stayed the same and flags every line that was added in the new version or deleted from the old one.

Under the hood it uses a longest-common-subsequence (LCS) algorithm to find the longest set of lines both versions share in order, then walks both texts once to emit an ordered list of equal, added, and deleted lines. This is the same approach used by source-control tools to show changes between two files.

Use the options to ignore differences in whitespace (so re-indented lines count as unchanged) or letter case (so capitalisation changes don't count as edits). The result reports the number of added and deleted lines plus a line-by-line change list you can scan at a glance.

Frequently asked questions

How is the diff calculated?
The tool splits both texts into lines and finds their longest common subsequence — the longest set of lines both texts share in the same order. Lines outside that shared sequence are marked as added (only in the new text) or deleted (only in the old text), and everything is stitched back into one ordered change list.
What do 'added' and 'deleted' mean?
An added line is one that appears in the second text but not in the first — a line you wrote or pasted in. A deleted line is one that was in the first text but is gone from the second. Unchanged lines appear in both and are shown for context so you can see where each change sits.
Can I ignore whitespace or case differences?
Yes. Turn on 'ignore whitespace' and lines that only differ by spacing or indentation are treated as unchanged. Turn on 'ignore case' and lines that only differ by capitalisation are treated as unchanged. These options affect how lines are matched, but the change list still shows the original text.
Is my text sent anywhere?
No. The comparison runs 100% in your browser. Nothing you paste is uploaded to a server, so this is safe for private or sensitive text.