Online text diff
Paste two pieces of text into the two boxes to compare them line by line, highlight additions, deletions and changes, and see how large the differences are. Everything is computed in your browser; nothing is uploaded.
Text to compare
Waiting for inputHow the diff works
This tool compares two texts line by line using the classic longest common subsequence (LCS) algorithm. It first finds the lines that are identical on both sides, then treats the lines that do not line up as either removed (present in the original only) or added (present in the new text only).
When a removal and an addition occur at the same position, they are paired and shown as a change, which reads closer to “this line was edited” than two disconnected events would.
The inline view lists removals followed by additions along a single timeline, which is good for reading the result top to bottom. The side-by-side view keeps the two columns aligned on the same difference, which is better for reviewing changes one at a time.
Comparison works on whole lines, so moving a line, adding a blank line or changing indentation all show up as a difference. To get a cleaner result, normalise indentation and line endings before pasting. For performance, only the first 2000 lines of each side are compared.
Everything happens in your browser with plain JavaScript — neither text is uploaded or stored.
Frequently asked questions
Do I need to align the two texts first?
No. The tool compares them line by line and works out what was added, removed or changed on its own, and the two sides do not have to be the same length.
What counts as a “changed” line?
When a removal and an addition sit at the same spot, they are paired and shown as a single change rather than two separate events.
Is there a size limit?
Yes — for speed, only the first 2000 lines of each side take part in the comparison; anything longer is trimmed and you get a notice.
Is my text uploaded?
No. The diff runs entirely in JavaScript in your browser and neither text ever leaves the page.