Text Diff Checker
Spot every change between two pieces of text. LCS-based line diff with inline word-level highlighting, a copyable unified patch and ignore-whitespace / ignore-case options.
What is the Text Diff Checker?
Text Diff Checker is a side-by-side comparison tool that highlights every addition, removal and change between two pieces of text. It uses a standard longest-common-subsequence algorithm at the line level, then runs a second word-level diff inside each changed row so you can see exactly which words moved or were rewritten — added words go green on the right, removed words go red on the left, and equal words stay neutral. The 'pair adds and removes as changes' option (on by default) gives a much cleaner output for prose by collapsing remove+add runs into single change rows. Toggleable options include ignore-whitespace (collapses runs of spaces/tabs), ignore-case and ignore-blank-lines. The result includes line numbers per side, a similarity percentage and a copyable unified patch (lines prefixed +/-/' ') that you can save as `.patch` or share. Pure functions, no network — your text never leaves the browser.
How to use it
- Paste the original text into the left pane and the modified text into the right pane.
- Toggle ignore-whitespace, ignore-case or ignore-blank-lines as needed for prose vs. code.
- Read the colour-coded side-by-side diff — green = added, red = removed, amber = changed (with inline word highlights).
- Copy a unified patch, download a .patch file, or swap the two sides with one click.
Benefits
- Standard LCS algorithm — same logic as `git diff`'s patience fallback, fast for browser use.
- Word-level highlighting inside changed rows so you can see the exact moved or rewritten words.
- Ignore-whitespace, ignore-case and ignore-blank-lines toggles for prose and code use cases.
- Pair add+remove as a single 'change' row — a much cleaner read for paragraph rewrites.
- Live similarity percentage and counts for added / removed / changed / unchanged lines.
- Copy a unified patch directly or download as a .patch file.
- Swap the two sides with one click without retyping.
- Runs entirely in your browser — Toollyz has no backend.
Frequently asked questions
What is a text diff?
A diff is a side-by-side or unified view of the differences between two pieces of text. Each line is classified as equal, added, removed or changed, and the tool highlights exactly which parts differ.
What algorithm does this use?
A standard O(m·n) longest-common-subsequence pass at the line level, followed by a second LCS pass at the word level inside each changed row. It's the same logic used by classic Unix `diff`.
What does 'ignore whitespace' do?
It collapses runs of spaces and tabs into a single space and trims each line before comparing — so a line where you only re-indented doesn't show as a change.
What does 'pair add and remove as change' do?
When a run of removed lines is followed by a run of added lines, the tool pairs them up into single 'change' rows side-by-side. This is much easier to read when you've rewritten a paragraph rather than inserted or deleted whole lines.
How big can the inputs be?
The LCS table is m × n integers, so memory use grows quadratically. In a browser, a few thousand lines per side is comfortable; tens of thousands may slow down.
What is the similarity percentage?
It's the number of unchanged lines divided by the larger of the two inputs' line counts — a rough but useful indicator of how much the two texts overlap.
Can I download a patch file?
Yes. The 'Download .patch' button saves a unified-style patch (lines prefixed with +, - or two spaces) that you can hand to anyone for review.
Why are some changed rows shown as separate add/remove instead of as a 'change'?
Toollyz pairs adds and removes only when they sit immediately next to each other. Leftovers — like 3 removes followed by 1 add — pair the first one and leave the rest as pure removes.
Does it work on code?
Yes. Use 'ignore whitespace' if formatting was the only change; leave it off if you care about indentation differences.
Is my text uploaded anywhere?
No. The diff runs entirely in your browser — Toollyz has no server that ever sees your text.
Can I compare files instead of pasting?
Not directly yet, but you can drag the file's contents into the text area, or open it in any editor and copy-paste both sides in.