How to compare two texts
- Paste the original on the left and the new version on the right, or open a file on each side.
- The differences appear below as you type. Red lines were removed, green lines were added, and changed lines show the removed words in red and the new words in green.
- Use Next change and Previous change to jump between differences in a long text.
Reading the result
- Side by side shows the two versions in two columns with matching lines facing each other, like a review tool. One column shows the removed line just above the added line, which reads better on a phone.
- Highlight words marks whole words that changed. Highlight letters marks single characters, useful for codes, numbers, spelling and punctuation.
- Long stretches of unchanged lines are folded so you see only the changes and three lines around each one. Click a fold to open it.
- The top line gives the share of lines left unchanged and how many lines were removed, added and changed.
Options
| Option | Use it when |
|---|---|
| Ignore capitals | Only the wording matters, not "Monday" versus "monday". |
| Ignore spaces | Spaces at the start or end of lines, double spaces or tabs changed (reformatted text, indented code). |
| Ignore empty lines | Blank lines were added or removed between paragraphs. |
Copy the changes as a patch
Copy as patch gives the differences in unified diff format, the format of diff -u and Git:
lines starting with - were removed, + were added, and @@ lines give the
position. Paste it into an email or a ticket, or apply it with patch.
What people compare
Two drafts of a contract or a letter, an old and new version of a web page's text, configuration files, two exports of the same report, code snippets, translations against their source. For two lists where the order does not matter, Compare two lists is the better tool: it matches items wherever they are.
Related tools
Guides
- How text compare works: the diff algorithm and how to read a patchHow diff tools find the changes between two texts: the Myers algorithm behind GNU diff and Git, word highlighting, and how to read a unified diff.
- Comparing JSON correctly: key order, duplicate keys and numbers over 2^53What the JSON standard says about key order, duplicate keys and number precision, and why a comparison built on JSON.parse misses changed IDs over 2^53.
Questions
How do I compare two texts for differences?
Paste one text on each side. The differences appear below: removed in red, added in green, changed words highlighted.
Is my text uploaded?
No. The comparison runs in your browser and the text never leaves your device. It is remembered in this browser only, and you can switch that off.
Can it ignore whitespace and capitals?
Yes. Turn on Ignore spaces and Ignore capitals above the boxes.
How large can the texts be?
Texts of tens of thousands of lines work. Very different texts take longer, because more lines have to be matched.
What is the difference with Compare two lists?
Text compare keeps the order of lines and shows where they changed. Compare two lists ignores order and tells you which items are in one list, the other or both.