Text Diff Checker
Paste two texts to compare. Additions are highlighted in green, deletions in red.
About the Text Diff Checker
A diff tool compares two blocks of text and highlights exactly what changed — additions in green, deletions in red. It uses the Myers diff algorithm (the same algorithm behind Git) to find the minimal set of changes needed to transform one text into the other, computing the longest common subsequence of both inputs.
Common uses for text comparison
- Document revision — compare two versions of a contract or report to see what changed between drafts.
- Code changes — check differences between two versions of a script or config file outside of version control.
- Data validation — compare API responses to spot unexpected changes.
- Content moderation — verify exactly what was edited in a submitted document.
Line-level vs character-level diffing
This tool compares line by line — any change to a line marks it as modified. For fine-grained comparison of prose, character-level diff shows the exact words that changed within each line. Git uses line-level diff by default; word processors typically use character-level.
Diff tools in software development
Git's diff command uses the Myers algorithm and is the most widely used diff tool in software development. Pull request reviews, merge conflict resolution, and code review tools all display diffs. Understanding how to read a unified diff format (lines with + are additions, lines with - are deletions, lines with neither are context) is a fundamental developer skill.
- Unified diff format — the standard format used by Git, patch, and most code review tools
- Git diff —
git diff HEAD~1shows changes since the last commit - Three-way merge — used in merge conflicts: original, your changes, and their changes are compared simultaneously
- Word-level diff — GitHub's "word diff" view highlights individual word changes within lines
Frequently Asked Questions
diff file1.txt file2.txt. Lines with < are only in file1, lines with > are only in file2. For side-by-side output use diff -y file1.txt file2.txt. On Windows PowerShell: Compare-Object (Get-Content f1.txt) (Get-Content f2.txt).