Text Diff Comparator
What is Text Diff?
A text diff tool compares two blocks of text and highlights the differences between them. It's essential for code reviews, document comparisons, and tracking changes between versions of text or code.
How to Use
- Paste the original text in the left panel
- Paste the modified text in the right panel
- Click "Compare" to see the differences
- Toggle between unified and side-by-side views
- Use "Copy Diff" to copy the diff output
Features
- Line-by-line comparison with color highlighting
- Unified and side-by-side view modes
- Line numbers on both sides
- Statistics: lines added, removed, unchanged
- Ignore whitespace option
- Copy diff as text with +/- prefixes
FAQ
What algorithm does this use?
This tool uses the Longest Common Subsequence (LCS) algorithm to compute diffs. It finds the longest sequence of lines common to both texts and identifies additions and deletions.
Can I compare code files?
Yes! This tool works with any text content including source code, configuration files, JSON, XML, and more. The monospace font makes code comparison easy.
Is there a file size limit?
For best performance, we recommend texts under 10,000 lines. Very large texts may slow down your browser due to the client-side processing.