⬅ Back to Home

🔍 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

Results are written into the page as markup, so angle brackets in the text you compare are rendered rather than shown. When comparing HTML or XML, expect tags to vanish from the report even though the comparison itself saw them.

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.

⬅ Back to Home