Something wrong with this tool?
About Text Diff (unified) Online
This tool compares two pieces of text and highlights the differences between them: lines that were added, removed, or changed. The visualisation makes it easy to spot what was modified between two versions, even in long documents.
Useful for comparing draft versions of an article, reviewing changes to a configuration file or contract, spotting differences in copied data, debugging output mismatches in code, or comparing a translated document to its original.
The tool supports both line-by-line and character-level diffs. Line-level is faster and easier to scan for large changes; character-level shows precise per-letter edits within a line, useful for catching small typos.
How to use this tool
How to compare two pieces of text line-by-line
Paste both versions
Drop the old version into "Left" and the new into "Right". The tool compares line by line — within-line word-level differences are NOT highlighted; that's a different (and more expensive) algorithm.
Press Run
Result returns an array of `diff` entries with `op` (`equal`, `added`, `removed`) and `text`. The order reflects the merged sequence — equals first, then any insertion/deletion runs, in source order.
Reading the output
Lines marked `added` exist only in Right, `removed` only in Left. Editor UIs typically render added in green and removed in red; the data structure is the same. Trailing newline differences may show up as a single `added`/`removed` line.
When line-level is too coarse
Long unchanged paragraphs with a single word edited will look as one removed + one added pair, not as a word-level diff. For prose review use a dedicated word-diff or character-diff library; line-diff is best for code.