The comparison says a line changed but I can't see any difference; why?
Nearly always there is a real difference that you cannot see: a space at the end of the line, two spaces instead of one between words, or a non-breaking space copied from a web page. Turn on 'Ignore whitespace differences' and that kind of difference disappears. If the line is still marked as modified, the cause is an invisible character, and cleaning the text before comparing fixes it.
How it happens
The comparison treats a space like any other character. When you copy a description from your store dashboard or a Word document, a trailing space often comes with it. Your eye cannot see it, but to the comparison the line is now 'Arabic coffee' followed by two spaces, which is a different text from 'Arabic coffee'.
The original has two lines: 'Arabic coffee', then 'Tea'.
The changed text: the same first line with two spaces after 'coffee', then 'Tea'.
With default settings: Added 1, Removed 1, of which modified lines 1, Unchanged 1.
With 'Ignore whitespace differences' on: a message says the texts are identical after ignoring what you chose to ignore.
What exactly does the option ignore?
In line comparison it strips spaces from both ends of each line and squeezes any run of spaces or tabs inside it into one space before matching. So 'Arabic coffee' with two spaces matches 'Arabic coffee'. A non-breaking space copied from a web page counts as a space here, so it is ignored too.
In word or character comparison without the option, space differences are not counted as additions or removals; they get their own counter, 'Whitespace-only differences'. For the example above, word comparison gives 0 added, 0 removed and 2 in that counter, which tells you straight away that spaces are the whole story.
If the line is still modified after ignoring spaces
Then the difference is not a space. The usual suspects:
- A zero-width space: a character with no width that rides along with text copied from some websites. We tried 'Arabic coffee' with one after 'Arabic', and the line stayed modified even with whitespace ignored, because the comparison does not treat it as a space.
- A look-alike letter: in Arabic, ة and ه, أ and ا, ي and ى. Matching is literal and does not merge them.
- Diacritics or a stretching character present in one version only.
To see exactly where the difference is, switch the level to Characters and only the odd character is highlighted. To remove hidden characters from the text itself, clean both versions with the Whitespace cleaner and compare again.
Ignore or clean?
The ignore option only changes how the comparison matches lines; it never touches your text. That is enough when your question is 'did the content change?'. If you are about to publish the text or import it into another system, the extra spaces are still there, so clean it and copy the clean version.
- Open Text comparison and paste both versions.
- Turn on 'Ignore whitespace differences' and see whether the differences vanish.
- If one remains, switch to Characters to find the character responsible.
Common questions
Do Windows and Mac line endings count as a difference?
No. In line comparison CRLF versus LF is not a difference, and neither is a final empty line.
Does the ignore option change the text I pasted?
No, it only affects matching. The text in both boxes stays as it is.
Why is the line shown as a modified pair rather than a removal and an addition?
Because its words are the same, so the two lines count as versions of one line.
