Compare the differences between two texts
The text diff tool puts two pieces of text side by side and uses a standard difference algorithm to find what was added and what was removed. The result is colour-coded in place: additions get a green background, removals get a red background with a strikethrough, and unchanged text stays plain. There are two levels of detail: 'Compare by line' suits config files, code snippets and lists, while 'Compare by word' suits prose and contract clauses where the edits are small. It compares only what you paste in; it does not merge texts or produce a patch file.
Take the built-in English sample. The original has the lines 'First line of text', 'Second line of text' and 'Third line of text'. The comparison text has 'First line of text', 'Second line of text, modified', 'Third line of text' and 'A new fourth line'. In 'Compare by word' mode the real output keeps 'First line of text' and 'Second line of text', adds a comma and the word 'modified', keeps 'Third line of text', and adds a line break followed by 'A new fourth line', which is a precise result. In 'Compare by line' mode the real output is: the first line kept, 'Second line of text' removed, 'Second line of text, modified' added, the third line kept, and 'A new fourth line' added. The tool first appends a newline to any text that lacks one, so the unchanged third line is not wrongly flagged.
Most likely the line endings differ: the line break type (Windows versus Unix) or trailing spaces are different. You can't see these, but the algorithm treats them as content. Make the endings consistent, or use 'Compare by word' to see the real edits.
Use line mode to locate which lines changed, for example when comparing two versions of a config file, a log or a checklist. Use word mode to see which words changed inside a sentence, for example when proofreading an article or reviewing a contract revision. A good routine is to look at lines first for the big picture, then switch to words for detail.
No. It only hides the unchanged segments from the display. The underlying result is the same, and unticking the box shows everything again.
No. The tool compares plain text pasted into the two boxes. For Word or PDF documents, copy the content out as plain text first; formatting, comments and images are not compared.
The comparison is performed in your browser by the diff library bundled with the page. The tool makes no network requests, your two texts are not uploaded or stored, and reloading the page restores the sample text.