About Text Diff
The Text Diff tool compares two blocks of text and produces a clear, color-coded visualization of every difference between them. Lines that were removed are highlighted in red, lines that were added are highlighted in green, and unchanged lines are shown without any highlight. This is the same concept as the "diff" output used in version control systems like Git.
How to Use
Paste your original text in the left field and the modified text in the right field. Click the "Compare" button to generate the diff. The results will appear below, showing every line with its change status. A summary at the top tells you exactly how many lines were added, removed, and left unchanged.
How It Works
This tool uses a Longest Common Subsequence (LCS) algorithm to compute the optimal line-by-line diff between the two inputs. The LCS algorithm finds the longest sequence of lines that appear in both texts in the same order, then marks everything else as either an addition or a deletion. This approach produces minimal, accurate diffs that are easy to read and understand.
Common Use Cases
- Code review — compare two versions of a code snippet to see what changed.
- Document editing — track changes between two drafts of an article, email, or report.
- Configuration comparison — spot differences between two config files or environment settings.
- Content verification — ensure that a copied text matches the original without accidental modifications.
- Translation review — compare the source text with a back-translation to check for accuracy.
All processing happens entirely in your browser. Your text is never uploaded to any server, making this tool safe for comparing sensitive or confidential content.