How to use
Paste the earlier version into “Original text” and the edited version into “Changed text”. Pick “Line”, “Word” or “Character” under “Compare by”, and you get a summary counted in that unit, such as “2 lines added”, “1 line removed” and “2 lines unchanged”, with the marked-up text below it. If the two texts don’t differ, the summary is replaced by “The two texts are identical.”
“Ignore whitespace” and “Ignore case” keep formatting-only differences out of the result. “Clear both” empties both boxes at once.
Compare by line, word or character
- Line: if even one character in a line changes, the whole line is shown as a removed line and an added line. This suits code, config files and lists, where each line is an item.
- Word: marks only the words that changed, across line boundaries. A run of Latin letters, digits or Korean letters counts as one word, while Chinese characters and Japanese kana, which are written without spaces, are split wherever the browser’s word segmentation divides them. In browsers without that feature, Korean, Chinese and Japanese characters are each handled one at a time. Spaces and punctuation marks are units of their own too.
- Character: compares every single character. Use it to check typos, punctuation and individual spaces.
The same edit produces different summary numbers in each mode. The example below changes ‘The quick brown fox jumps’ to ‘The quick red fox leaps’.
| Compare by | Added | Removed | Unchanged |
|---|---|---|---|
| Line | 1 line | 1 line | 0 lines |
| Word | 2 words | 2 words | 7 words |
| Character | 5 characters | 7 characters | 18 characters |
The 7 unchanged words in “Word” mode are the three words The, quick and fox plus the four spaces between the words. With “Ignore whitespace” on, spaces aren’t counted and the figure becomes 3 words. “Character” mode matches letters that overlap by chance, such as the r that brown and red share, so when whole words have been swapped the marking breaks into small pieces and gets hard to read.
Viewing word changes: On a wide screen, the easiest view to read is “Line” mode in the “Side by side” layout. It pairs up the changed lines and then marks the words that differ within them, split at spaces, in a stronger shade. Change ‘the quick brown fox jumps’ to ‘the quick red fox jumps’ and only ‘brown’ and ‘red’ get the stronger shade. “Word” mode also compares word by word rather than character by character, but it shows the text as one continuous flow, without line numbers or matching lines placed at the same height.
Ignoring whitespace and case
What “Ignore whitespace” ignores depends on the mode.
| Compare by | Differences ignored | Differences still shown |
|---|---|---|
| Line | Whitespace at the start and end of a line | The number of spaces in the middle of a line (a b and a b are different lines) |
| Word | The amount and kind of whitespace between words (a lot and a lot are equal) |
Words written together versus apart (alot and a lot are different) |
| Character | The kind of whitespace character (a tab equals a space) | The number of whitespace characters (a b and a b differ by 1 character removed) |
Code where only the indentation changed is filtered out when you turn the option on in “Line” mode. To see where the wording changed in a draft where only the number of spaces or the position of line breaks differs, turn it on in “Word” mode.
“Ignore case” treats Hello and hello as equal in all three modes. The two options can be on together.
Reading the result
A wide screen shows the “Side by side” layout and a narrow one shows “Unified”. The choice follows the screen width automatically, and there is no button to switch. Both are the same comparison laid out differently.
- Side by side: “Original text” on the left, “Changed text” on the right. In “Line” mode the lines are numbered and matching lines sit at the same height. A line that exists on one side only leaves a gray blank on the other.
- Unified: merges the two texts into one and shows the removed and added parts in reading order.
In “Line” mode a removed line is prefixed with − and an added line with +, and the background color changes. In “Word” and “Character” mode, removed parts get a strikethrough and a red background, and added parts get an underline and a green background. Because a symbol or a line always accompanies the color, you can read the result even if you have trouble telling red from green.
The copy button next to the summary copies the result as text with markers. In “Line” mode each line starts with + (added), - (removed) or a space (unchanged). In “Word” and “Character” mode, added parts are wrapped in {+ +} and removed parts in [- -]. Copy the “Word” result for ‘the quick brown fox’ changed to ‘the slow brown fox’ and you get the [-quick-]{+slow+} brown fox.
Long texts and texts that differ a lot
When the two inputs add up to more than 200,000 characters, the note “Large input. Comparing may take a moment.” appears. The comparison still runs.
How different the two texts are matters more than how long they are. If the additions and removals together exceed 4,000 units of the chosen mode, or the calculation takes longer than 1.5 seconds, the tool stops looking for the changed parts and shows the whole original as removed and the whole changed text as added. The note “The input was too large or too different, so the detailed comparison was skipped and the whole text is shown as replaced.” appears with it. A long text rewritten from scratch reaches this limit quickly in “Character” mode. When that happens, switch to “Line” mode or compare the text in sections.