Paste two versions of text below to see added and removed lines highlighted.
Added0
Removed0
About this diff checker
This tool compares two texts line by line using a longest common subsequence (LCS) algorithm — the same core idea used by version control diff tools — to find the smallest possible set of added and removed lines that turns Text A into Text B.
Lines that appear only in Text B are marked as added, lines that appear only in Text A are marked as removed, and lines that match exactly in both are left unmarked. This tool compares whole lines, not individual characters within a line.
How does line-by-line text diffing work?
This tool splits both texts into lines and finds the longest common subsequence (LCS) of lines shared between them — the longest ordered sequence of lines that appears in both texts. Any line in Text A not part of that shared sequence is marked removed, and any line in Text B not part of it is marked added. Example: changing one word inside a sentence causes that whole line to show as one removed line and one added line.
Steps to compare two texts
Paste or type the original text into the Text A box.
Paste or type the updated text into the Text B box.
The comparison updates automatically as you type, splitting both texts into lines.
Lines only found in Text B are shown highlighted as added; lines only found in Text A are shown highlighted as removed.
Use the swap button to reverse which text is treated as the original if you pasted them in the wrong order.
How the LCS diff algorithm decides what changed
Shared lines = longest common subsequence(Text A lines, Text B lines) · Removed = lines in A not in the shared sequence · Added = lines in B not in the shared sequence
Longest common subsequence (LCS) = the longest sequence of lines that appears, in the same relative order, in both texts (not necessarily consecutive)
Line-level diff = comparison performed on whole lines; a one-character change inside a long line still marks that entire line as changed
Example line comparison
Text A line
Text B line
Result
The quick brown fox
The quick brown fox
Unchanged
jumps over the lazy dog.
jumps over the sleepy dog.
1 removed + 1 added
(not present)
A new line was inserted here.
1 added
This line was deleted.
(not present)
1 removed
Frequently asked questions
Why does changing one word mark the whole line as changed?
This tool compares text at the line level, not the character level, so if even a single character differs between two lines, they are treated as two different lines: the old version is marked removed and the new version is marked added, rather than highlighting just the changed word.
Why do reordered lines show as both added and removed?
If a line moves to a different position relative to the surrounding lines, it may fall outside the longest common subsequence at its new location, so it can appear as a removed line at its old position and an added line at its new position, even though the text itself is unchanged.
Does this tool ignore whitespace or capitalization differences?
No. Lines are compared for an exact match, so differences in leading spaces, trailing whitespace, or letter case will cause two otherwise-identical-looking lines to be treated as different.
Is my text uploaded anywhere to compare it?
No. Both text boxes are compared entirely with JavaScript running in your browser; nothing is sent to a server.
This tool performs a line-level diff only; it does not highlight the specific characters or words that changed within a modified line, and very large texts (thousands of lines) may be slower to compare due to the algorithm's complexity.