What Is a Text Diff Tool?
A text diff tool compares two text documents side by side and highlights the differences between them. It identifies additions, deletions, and unchanged sections, making it invaluable for proofreading, document versioning, and content review.
How to Use This Text Diff Tool
- Paste both texts into the single input area, separated by a line containing only
---or===. Everything above the separator is treated as the original text, and everything below is the revised text. - Click Compare to compare the two sections.
- The output displays a line-by-line diff with additions (
+), deletions (-), and unchanged lines, followed by a summary of total additions and deletions.
Key Concepts
Diff algorithms work by finding the Longest Common Subsequence (LCS) between two texts. Additions appear highlighted in green, deletions in red, and unchanged text provides context. Word-level diffs show precise changes within lines, while line-level diffs compare entire lines as units. This is the same principle behind git diff and track changes in word processors.
Frequently Asked Questions
Can I compare formatted documents?
This tool compares plain text. For formatted documents, export to plain text first or use a specialized rich-text comparison tool. Formatting markup (HTML, Markdown) is compared as text.
How does it handle whitespace differences?
By default, all whitespace changes are shown. This includes trailing spaces, tab vs. spaces, and line ending differences (LF vs. CRLF).
What is the maximum text length supported?
Browser-based diff tools can handle texts of tens of thousands of lines. Very large files may cause slower processing due to the algorithm’s computational complexity.