Compare two text blocks line by line with highlighted differences
Text Diff is the process of comparing two pieces of text line by line to identify additions, deletions, and modifications. It is a fundamental operation in code review, document version control, and content proofreading, allowing you to pinpoint exact changes between two versions.
@@ -1,3 +1,3 @@
unchanged line
-deleted line
+added line
- prefix = only in the old version (red) · + prefix = only in the new version (green) · space prefix = same in both versions
Based on the LCS (Longest Common Subsequence) algorithm, which finds the longest shared sequence of lines between the two texts and marks the rest as additions or deletions. Word-level and character-level comparison are also supported for spotting subtle inline changes.
This is usually caused by inconsistent line endings (Windows \r\n vs Unix \n). Normalize line endings first, or enable the "ignore whitespace" option.
This tool runs entirely in the browser and can typically handle tens of thousands of lines. For very large files (>10 MB), use a local diff tool like git diff or VS Code.
Line-level diff marks entire lines as changed — good for structural changes. Character-level diff highlights individual differing characters within a line — ideal for catching typos or minor edits.