Text Diff
Compare two texts and see the differences between them.
Text too large (more than 500 lines). Please shorten the text for the diff view.
No difference – both texts are identical.
No diff yet – paste text into both fields.
Line-by-line diff
The LCS (Longest Common Subsequence) algorithm compares both texts line by line and highlights exactly what was added, removed or left unchanged.
Color-coded highlighting
Added lines appear in green, removed lines in red. Spot changes at a glance without reading line by line.
Privacy first
Your text never leaves the browser. All processing happens locally in JavaScript — perfect for sensitive content and code.
Frequently asked questions
Answers to common questions about text comparison
The tool uses the LCS (Longest Common Subsequence) algorithm to find the longest common sequence of both texts. Lines that only appear in the original are marked as removed (red), lines only in the modified text as added (green), and shared lines as unchanged.
Yes, for performance reasons the comparison is limited to 500 lines per text. The LCS algorithm has quadratic time complexity, which would cause noticeable delays with very long texts. For larger texts we recommend a terminal tool like `diff`.
No. All calculations happen locally in your browser. No text is sent to a server or stored. The data disappears as soon as you close the page or refresh the browser.
The "Copy diff" button creates a text in the classic diff format: lines with a "+ " prefix are added, lines with "- " are removed and lines with " " (two spaces) are unchanged. This format is compatible with many text editors and Git tools.
Yes, the tool works great for code comparisons. Since the comparison is line-based, you can quickly see which lines of code were changed, added or removed. Note that only whole lines are compared — no character-precise differences within a line.