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

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.

Frequently Asked Questions

What does a diff tool do?
It compares two texts and shows exactly which lines were added, removed, or unchanged. Added lines appear in green, removed lines in red. This lets you spot differences without reading both documents manually, which is especially valuable for long contracts, code files, or configuration documents.
How does the diff algorithm work?
The Myers algorithm finds the longest common subsequence of lines shared between both texts, then marks everything else as either an addition or a deletion. This produces the minimum number of changes needed to go from one text to the other.
Can I compare code files with this tool?
Yes. Paste two versions of any code, JSON, YAML, or config file. The comparison is text-based and works on any plain text regardless of programming language or file format.
Is my text sent to a server?
No. All comparison runs entirely in your browser. Your text never leaves your device, making this safe to use with confidential documents, source code, or proprietary data.
How do I compare two files on the command line?
On Linux/Mac: 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).
Related tools
Ad