Last updated: March 2026
How Text Diff Works
Text diff tools use an algorithm called Longest Common Subsequence (LCS) to find the most efficient description of changes between two texts. Rather than simply comparing character by character, the algorithm identifies which lines are the same, which were added, and which were removed.
Version control systems like Git process billions of text diffs daily across platforms like GitHub, which hosts over 200 million repositories.
The comparison happens at two levels. Line-level diff identifies which lines changed between the two versions. Then, for lines that were modified (not purely added or deleted), word-level diff drills deeper to highlight the specific words that differ. This makes small changes within long lines immediately visible.
Side-by-side view shows both versions aligned so matching lines appear at the same position. Inline view merges everything into a single stream with + and − markers, similar to how version control systems like Git show changes.
Options like "ignore case" and "ignore whitespace" help you focus on meaningful changes. Comparing code? Ignore whitespace to skip formatting differences. Comparing legal documents? Keep everything enabled to catch every change, even capitalization.
Frequently Asked Questions
How does the text diff work?
The tool compares your two texts line by line using a diff algorithm. It identifies which lines were added, removed, or modified. For modified lines, it can further highlight the specific words that changed within each line.
What do the colors mean?
Green highlights show additions (text in the changed version but not the original). Red highlights show deletions (text in the original but not the changed version). Yellow highlights show modifications (lines that exist in both but with different content).
What is word-level diff?
When enabled, modified lines show exactly which words changed, not just that the line is different. This makes it easy to spot small changes like a single word swap or typo fix within a longer line.
Can I compare code with this tool?
Yes. The monospace font and line numbers make it well-suited for comparing code. Use 'Ignore whitespace' to focus on meaningful changes and ignore formatting differences.
Is my text sent to a server?
No. All comparison happens in your browser using JavaScript. Your text never leaves your device. Nothing is stored or transmitted.
What's the similarity percentage?
It shows what percentage of the text is identical between both versions. 100% means the texts are the same, 0% means completely different. It's calculated based on the number of matching characters relative to the total.