Text Diff

Compare two texts and highlight every difference. Line-by-line diff.

🔒 100% client-side
Options
Original
Modified
Diff Result
+ Added βˆ’ Removed Unchanged
How Text Diff Works

LCS algorithm β€” Text Diff uses the Longest Common Subsequence (LCS) algorithm to compute the minimal set of changes between two texts. This is the same approach used by git diff and most professional diff tools.

Line-by-line comparison β€” Each line is compared individually. A line counts as "changed" if it appears as a deletion in the original and an addition in the modified text, even if the change is just one character.

Ignore options β€” Enable "Ignore case" to treat uppercase and lowercase as equal. Enable "Ignore whitespace" to ignore leading/trailing spaces when comparing lines (useful for code reformatted with different indentation).

Large files β€” For inputs over 1,000 lines, a simplified O(n) algorithm is used automatically to keep the tool fast.

Keyboard shortcut β€” The diff updates automatically ~700ms after you stop typing. Click Compare to force an immediate update.

About Text Diff

Text Diff compares two blocks of text line by line and highlights exactly what changed β€” directly in your browser. Paste original text on the left and modified text on the right, then click Compare (or just start typing) to see additions highlighted in green and deletions in red. Uses an LCS-based algorithm β€” the same approach as professional diff tools β€” to produce the minimal set of changes. Nothing leaves your device.