DiffScope

Compare two texts or files side by side and highlight every difference.

100% client-side

Text A

0 lines

Text B

0 lines

Differences

How text comparison works

DiffScope splits both texts into lines and finds the longest common subsequence (LCS) between them — the same mathematical principle behind Unix diff and git diff. Lines that are in both texts and in the same order are marked as equal; the rest is marked as removed (only in A) or added (only in B):

Text A           Text B
function f() {   function f() {
  return 1;         return 2;      ← changed (removed + added)
}                 }
                    console.log(1); ← added

All the computation runs in your browser with native JavaScript — no external libraries, no server calls.

Frequently asked questions

What algorithm does it use to compare the texts?

A line diff based on the longest common subsequence (LCS), the same principle used by tools like Unix diff or git diff, adapted to show the result side by side.

Does it compare word by word or line by line?

Line by line: each line is marked as equal, added or removed. If a line changes by even one character, it's marked as removed in text A and added in text B.

Can I compare files instead of pasting text?

Yes, each panel has a button to load a local text file; it's read with the browser's File API and never uploaded to a server.

Is there a size limit?

The LCS algorithm is O(n×m), so very long documents (several thousand lines each) can get slow; the tool warns you if the pair of texts exceeds a safe limit.