Diff Checker
Compare two texts and highlight the differences line by line.
How diff algorithms work
A diff (difference) algorithm compares two texts line by line (or character by character) and identifies which parts were added, removed, or unchanged. The most widely used algorithm is the Myers diff algorithm (1986), which finds the shortest edit script β the minimum number of insertions and deletions needed to transform text A into text B. Git, GitHub, and most code review tools use variants of this algorithm.
Reading a diff output
Standard unified diff format:
--- original.txt (file A)
+++ modified.txt (file B)
@@ -1,4 +1,4 @@ (line numbers affected)
unchanged line (starts with space)
-removed line (starts with minus = was in A, not in B)
+added line (starts with plus = in B, not in A)
another unchanged
Colour convention (used by this tool and GitHub):
Red background = deleted (existed in A, gone in B)
Green background = added (new in B, not in A)
No colour = unchangedCommon uses for diff comparison
Line diff vs. word diff vs. character diff
Different diff granularities suit different use cases. Line-level diffs (the standard in Git) are ideal for code where changes are meaningful at the line level. Word-level diffs are better for prose documents where sentences span multiple lines. Character-level diffs reveal subtle changes like spacing or punctuation that line diffs might obscure.
Line diff (standard):
- The quick brown fox jumped over the lazy dog.
+ The quick brown fox jumps over the lazy dog.
Word diff:
The quick brown fox [-jumped-]{+jumps+} over the lazy dog.
Character diff:
The quick brown fox jump[-ed-]{+s+} over the lazy dog.Frequently asked questions
What does a diff checker do?
It compares two pieces of text and highlights exactly where they differ β added, removed and changed lines β so you can spot edits between two versions at a glance.
Is my text uploaded anywhere?
No. The comparison runs entirely in your browser, so both texts stay private on your device.
Can I compare code as well as plain text?
Yes. It works on any text β source code, configuration files, articles, contracts β anywhere you need to see what changed between two versions.
What is the difference between a line diff and a word diff?
A line diff marks whole lines as changed, while a word diff highlights the specific words that differ within a line. Line diffs are best for code; word diffs are clearer for prose.
Compares two texts line by line. π’ Green = added lines π΄ Red = removed lines π‘ Yellow = changed lines White = unchanged