🔍 Text Compare Tool
Paste two pieces of text below and compare:
How the comparison works
Both boxes are trimmed, split on newlines, and walked one line at a time by position. Nothing clever happens in between:
A = textA.trim().split("\n")
B = textB.trim().split("\n")
for i in 0 .. max(A.length, B.length) - 1:
if A[i] !== B[i]: report "Line i+1" with both versions
So this is a positional check, not a real diff. Add one extra line at the top of B and every line below it is reported as changed, because nothing here notices that B is simply shifted by one. Where the run of differences starts is the answer.
What counts as a difference
- Case matters.
Totalandtotalare a difference, as is a single trailing space inside a line. - Blank lines at the very start or end are ignored by the trim, but a blank line in the middle is a line like any other and shifts everything after it.
- Nothing leaves your browser. No upload, no sign-in, no cost - the comparison runs in the page itself.
- Swap A & B exchanges the two boxes, which is the quick way to re-read a long result from the other side. Clear empties both and the result.
Frequently asked questions
Why does it say every line is different when I only added one?
Because lines are matched by number, not by content. Inserting a line at the top pushes the rest down one, so line 5 in A is compared with line 4's text in B. Read where the shift starts, not every line after it.
Does it ignore differences in spacing?
Only at the very beginning and end of each box. Two spaces instead of one inside a line make that line different, which is usually what you want when comparing code or data.
Can I compare two files rather than pasted text?
Not directly - there is no file picker. Open each file, copy its contents into box A and box B, and compare. Nothing is uploaded either way.