How to Compare Text
- Paste the first version into Original Text and the second into Changed Text. On a phone the two boxes are one above the other.
- Read the figures: lines added, lines removed, lines unchanged, and the words added and removed.
- Read the result line by line. A line with + was added and a line with − was removed. Inside a changed line, the added words are underlined and the removed words are struck through. The left number is the line in the original and the right number is the line in the changed text.
- Pick By Word under Show Differences to see the whole text as one run of words, with removed words struck through and added words underlined.
- Turn on Ignore case or Ignore whitespace when capitals or spaces do not matter, then press Copy Result to copy the differences as plain text.
Example With Changed Opening Hours
The example compares two versions of a short notice. The new version changes the weekday opening time, the Sunday hours and the booking line, and adds one line at the end:
Opening hours - Monday to Friday: 9am to 6pm + Monday to Friday: 8am to 6pm Saturday: 10am to 4pm - Sunday: closed - Call 555 0100 to book a table. + Sunday: 11am to 3pm + Book a table online or call 555 0100. We take cash and cards. + Dogs are welcome on the terrace.
That is the result as Copy Result copies it: + for an added line, – for a removed line and two spaces for a line that is the same. There are 4 lines added, 3 removed and 3 unchanged. In the first changed pair, 9am is struck through and 8am is underlined, and the rest of the line is plain because it did not change.
Compare Two Texts by Word
By Word compares the words of the two texts in order, with line breaks and spaces left out of the comparison. It is the clearer view when a paragraph was rewrapped, or when one word changed in a long line. In the example, 16 words were added and 7 removed. Copy Result in this view marks removed words as [-word-] and added words as {+word+}.
Ignore Case and Whitespace
| Original | Changed | Switch | Lines Unchanged |
|---|---|---|---|
The Cat sat. | the cat sat. | Off | 0 |
The Cat sat. | the cat sat. | Ignore case on | 1 |
one··two / three· | one·two / ··three | Off | 0 |
one··two / three· | one·two / ··three | Ignore whitespace on | 2 |
In the table, · stands for a space and / for a line break. With Ignore whitespace on, spaces and tabs at the start and end of a line are left out and a run of spaces inside a line counts as one space, so a line that was only indented or rewrapped with extra spaces is the same. Line breaks still count, so joining two lines is still a change.
How the Two Texts Are Compared
The two texts are compared with the difference algorithm Eugene Myers published in 1986, in its linear-space form. The result has the fewest lines removed and added that turn the original into the changed text, which is the same as keeping the longest sequence of lines the two texts have in common, in order. Each changed line is then compared word by word with the line it replaced, with the same algorithm, so only the words that differ are marked.
The results were checked on 500 generated pairs of texts against a longest common subsequence worked out a second way and against the difflib module of Python, whose matches were never longer and were shorter in some cases. A line ends at a line break, and a final line break does not add an empty line. Each box takes up to 10,000 characters, and with two very different long texts the last part may be marked as removed and added in one block, with a note about it in the result. The texts are compared in your browser, and nothing you type is sent anywhere or stored.
FAQs
Q1. How Do I Compare Two Texts for Differences?
To compare two texts for differences, paste the first version into Original Text and the second into Changed Text. Each added line is marked with + and each removed line with a minus sign, and inside a changed line the added words are underlined and the removed words struck through, so you can read every edit without checking the texts by eye.
Q2. Can I Compare Text Without Case or Spaces Mattering?
You can compare text without case or spaces mattering by turning on Ignore case, Ignore whitespace or both. With Ignore case on, The and the count as the same, and with Ignore whitespace on, extra spaces and indents are left out, so only changes to the words themselves are marked.
Q3. What Is the Difference Between By Line and By Word?
The key difference is what counts as one unit. By Line compares whole lines and lists each one as added, removed or the same, whereas By Word compares the words of the whole text in order and leaves line breaks out, which suits a paragraph that was rewrapped or edited in the middle.
Q4. Is Compare Text Safe for Private Documents?
Compare Text is safe for private documents because the two texts are compared in your browser and are not sent to a server or stored, so nothing you paste leaves your device.
Q5. How Much Text Can I Compare?
You can compare up to 10,000 characters in each box, spaces and line breaks included. For a longer document, compare it one part at a time, so each result is short enough to read through.
Sources
Eugene W. Myers, An O(ND) Difference Algorithm and Its Variations, Algorithmica 1 (1986), pages 251 to 266. Python Software Foundation, difflib documentation (used to check the results). Checked 12 November 2026.