Free Text Diff Checker
Compare any two blocks of text side by side and see exactly what changed. Added lines are highlighted in green, removed lines in red, and unchanged lines in white. Great for comparing document versions, code snippets, config files, translated text, and more. 100% browser-based — your text never leaves your device.
🔍
Line-by-line diff
Uses the LCS algorithm — the same approach as Git diff — for accurate change detection.
🎨
Color-coded output
Green lines were added, red lines were removed, plain lines are unchanged.
🔒
100% private
All comparison happens in your browser. Your text is never sent to a server.
Frequently Asked Questions
How does the diff work?+
The diff uses the Longest Common Subsequence (LCS) algorithm to find the minimum set of changes needed to transform the first text into the second. This is the same algorithm used by Unix diff and version control systems like Git.
Can I compare code files?+
Yes. Paste any code — JavaScript, Python, JSON, YAML, HTML — and the diff will highlight exactly which lines changed. This is useful for reviewing changes before committing or comparing configuration files.
Does it compare word by word or line by line?+
The primary diff is line-by-line. Within changed lines, individual word differences are highlighted to make it easier to spot small changes inside a line.
Is there a size limit?+
No artificial limit. The LCS algorithm is O(n²) in the worst case, so very long texts (10,000+ lines) may take a second to process. Most practical comparisons are instant.
Is my text stored anywhere?+
No. All comparison happens in your browser with JavaScript. Your text is never sent to any server.
You might also like
How Text Diff Works
This tool uses the Longest Common Subsequence (LCS) algorithm — the same algorithm used by Unix diff, Git, and most version control systems. LCS finds the largest set of lines that appear in the same order in both texts, then marks everything else as added or removed. This produces the minimum edit distance: the smallest number of insertions and deletions to transform text A into text B.
Use Cases for Text Diff
Text diff is useful far beyond code. Common uses include: comparing two versions of a legal document or contract, checking what changed between two translations, reviewing edits in an article or essay, comparing configuration files between environments, verifying that a copy-paste preserved all content, and spotting unintentional changes in generated output between runs.