Compare two texts and see exactly what changed, in a side-by-side or inline view, at line or word level.
All calculations happen locally in your browser. Nothing leaves your device.
Comparing two texts is a classic computer science problem: find the smallest set of edits that turns one into the other. This tool solves it with the longest common subsequence (LCS) algorithm — it finds the longest sequence of lines (or words) shared by both texts in the same order, and everything else is reported as an addition or a removal. No server, no network, just your two texts and a bit of dynamic programming in your browser.
The core is the classic longest common subsequence (LCS) algorithm. The two texts are split into lines, and LCS finds the largest set of lines that appear in both, in the same order. Lines in the original but not in the modified are removals; lines in the modified but not in the original are additions. Dynamic programming computes this in O(n·m) time.
Line level treats each whole line as one unit: if any character on a line changed, the entire line is marked as removed (red) and the replacement as added (green). Word level first aligns lines as usual, then re-diffs changed line pairs word by word with a second LCS pass, so you see exactly which words were inserted or deleted within a line.
Yes. Paste two versions of a function, a config file or a commit's before/after and the tool shows the changed lines. Word level is especially useful for code because it pins down the exact token that changed on an otherwise long line.
Green background marks content that was added in the modified text; red background marks content that was removed from the original. Unchanged content has no background. The counters above the view show how many lines were added and removed.
No. Both texts and the entire LCS computation run as JavaScript in your browser tab. Nothing is uploaded, transmitted or stored — close the page and it is gone.
Reviewing a config file instead? Compare structure and values key by key with JSON Diff, or profile each version's writing with the Word Frequency Counter.
If you just finished with Text Diff, the natural next steps are Word & Character Counter, Text Case Converter, Base64 Encoder & Decoder, or browse every tool in Privacy File Tools.