What is the Text Diff Checker?
The Text Diff Checker compares two blocks of text or code side-by-side, visually highlighting differences, additions, deletions, and modifications. With color-coded highlights (green for additions, red for deletions), it makes spotting edits between drafts, versions, or code files effortless.
Tracking revisions across legal agreements, auditing code changes before committing, proofreading translated texts against original drafts, and resolving merge conflicts require instant, reliable visual diffing without installing heavy desktop utilities.
How to Use the Text Diff Checker
- Enter Original Text: Paste your baseline or older draft into the left editor (Original).
- Enter Modified Text: Paste your revised draft into the right editor (Modified).
- Click Compare Text: The tool performs an immediate Myers LCS (Longest Common Subsequence) diff.
- Inspect Differences: Review red strike-through removals and green highlighted additions.
Formula & How It Works
Diffing is computed using the classical Longest Common Subsequence (LCS) algorithm:
Let A = array of tokens from Text 1
Let B = array of tokens from Text 2
1. Build dynamic programming matrix L of size (|A|+1) x (|B|+1)
2. For i from 1 to |A|:
For j from 1 to |B|:
if A[i-1] == B[j-1]: L[i][j] = L[i-1][j-1] + 1
else: L[i][j] = max(L[i-1][j], L[i][j-1])
3. Backtrack through matrix to output diff ops:
- Match: Keep token
- Insertion: Highlight green (+)
- Deletion: Highlight red (-)Worked Example: Original: "The quick brown fox". Modified: "The fast brown fox". The tool marks "quick" as deleted (red) and "fast" as inserted (green).
Practical Worked Examples
| Original Text | Modified Text | Visual Diff Result |
|---|---|---|
| "Price: $50" | "Price: $45" | Price: |
| "const user = null" | "let user = null" |
Common Everyday & Professional Use Cases
Comparing contract revisions before signing, proofreading editorial drafts, tracking configuration file modifications, reviewing code patches, and finding subtle typos.