Compare two texts
Find the differences between two texts by words, lines or characters.
- Runs right in your browser
- Free, no sign-up
More about Compare two texts
How text comparison works
Paste the original and the new wording. The tool finds the longest common part of both versions and marks the rest: whatever is missing from the new text is struck through in red, whatever was added is green. Alongside that it calculates the match as a percentage and counts the added and removed words, lines or characters.
- By words suits ordinary text: contracts, articles, emails. A change inside a sentence only highlights the words concerned.
- By lines matches the way git and code editors report differences. Use it for code, lists and tables pasted as text.
- By characters reveals a typo inside a word or a changed digit.
- Side by side puts both texts in two columns with line numbers, changed lines are shaded.
The difference downloads in the unified diff format, the same one produced bydiff -u. Any editor opens it and it can be applied as a patch.
Frequently asked questions
How is the match percentage calculated?
From the letters and digits that stayed unchanged, relative to the longer of the two texts. Spaces and line breaks are not counted, so an added blank line does not lower the match.
What do the ignore case and ignore whitespace options do?
With ignore case on, “Contract” and “contract” are the same word. Ignore whitespace overlooks spaces at the start and end of a line and repeated spaces inside it, while paragraph breaks are kept. The result always shows the text as you typed it.
How long can the texts be?
Each text can have up to 200,000 characters. For very long texts with many changes the tool switches to a faster approximate comparison and tells you so; the result may then report slightly more changes than necessary.
Can it compare two Word or PDF files?
Not directly, the tool works with plain text. Copy the content of the document and paste it into the boxes; formatting is lost and only the text is compared.
Are the texts sent to a server?
No, the comparison runs in your browser and the texts never leave it.