Text Diff Checker
Comparing two versions gives 1 removed line, 1 added line and 1 unchanged line. Within the changed line, only the word "brown" became "red".
How to use
- Paste the original text on the left and the changed text on the right.
- Added lines are green, removed lines are red, and the words that changed inside a line are highlighted more strongly.
- Switch between side-by-side and unified view. Turn on the options to ignore case or whitespace, or to show only the changes with a little context.
- Press Copy diff to copy the unified view with - and + prefixes.
How it works
The comparison uses the Myers O(ND) algorithm (Eugene W. Myers, 1986), the same family of method that diff and git use. It finds a shortest list of line insertions and deletions that turns the left text into the right text.
When a block of removed lines is followed by a block of added lines, the lines are paired in order and compared again word by word, so you can see which words inside a line changed.
Ignore case lowercases both sides before comparing. Ignore whitespace trims each line and treats runs of spaces as one. The text shown is always your original.
If the two texts differ so much that more than 3,000 edits are needed, the tool stops looking for the shortest script and shows the differing middle part as removed and added. A notice tells you when this happens.
FAQ
What is the difference between side-by-side and unified view?
Side-by-side puts the original on the left and the changed text on the right, with changed lines paired. Unified lists every line once, with a minus for removed lines and a plus for added ones, as in a patch file. On narrow screens the two sides stack.
Why is a changed line shown as one removed and one added line?
A line is compared as a whole. If any character differs, the old line counts as removed and the new one as added. The highlighted words show where inside the line the difference is.
Does it compare Japanese, Korean or Chinese text?
Yes. Line comparison works for any text. For the word highlights, a run of letters without spaces is treated as one unit, so a changed Japanese or Chinese sentence is highlighted as a whole chunk rather than character by character.
Are Windows and Unix line endings different?
No. CRLF, LF and CR endings are treated the same, and a single line break at the very end of the text does not count as an extra line.
Is my text uploaded?
No. The comparison runs in your browser and nothing is sent to a server.