Text Diff Checker
Paste two texts to compare. Additions are highlighted in green, deletions in red.
More Tools
About text diffing
Text comparison tools (diffing) are essential in software development for reviewing code changes, comparing document versions, and spotting differences in configuration files. The unix diff command and tools like Git use similar LCS-based algorithms.
Frequently Asked Questions
How does the diff algorithm work?
This tool uses the Longest Common Subsequence (LCS) algorithm to identify lines that are the same between the two texts. Lines present in the modified text but not the original are highlighted in green (added). Lines in the original but not the modified are highlighted in red (removed).
Can I compare code with this tool?
Yes. The text diff tool works on any text content including code. For code-specific diffing with syntax highlighting and more advanced features, dedicated tools like GitHub's diff view or the unix diff command offer more options.
Is there a maximum text size?
The LCS algorithm runs in O(m×n) time and memory where m and n are the number of lines. Very large texts (thousands of lines each) may take a moment to process. For best performance, compare texts under 500 lines each.