What the Text Compare does
Text Compare puts two editors side by side, labelled Original and Revised. Each text is split into lines, and line 1 of the original is set against line 1 of the revision, line 2 against line 2, and so on. Every row is given one of four states: same, changed, added (the revision has a line where the original has none) or removed (the original has a line where the revision has none). A summary above the rows reports how many lines differ and how many are unchanged.
The alignment is by position, not by content. The tool does not search for a line that has moved, and it does not try to find the smallest set of insertions and deletions the way git diff or GNU diff does. That makes it quick and predictable for texts with the same line structure: two exports of the same report, a configuration file before and after a value changed, two versions of a list with the same number of entries.
Matching is exact. A line counts as unchanged only when every character is identical, so a capital letter, a trailing space or a tab in place of spaces is enough to mark a row as changed. There is no word-level highlighting inside a row; you see the whole original line on the left and the whole revised line on the right.
Suits quick checks on lists, key-value settings, translation strings, SQL output and generated text. It is not a replacement for a version-control diff on source code, and it is not designed for prose where paragraphs reflow.
How to use it
Paste the original text
Put the earlier version in the left editor, labelled Original. Plain text only; formatting from a word processor is dropped on paste.
Paste the revised text
Put the newer version in the right editor. Press Compare. The summary and the row list appear below the editors; edit either box and press Compare again to refresh them.
Read the row list
Each row shows its line number, the original line and the revised line, coloured by state. The summary gives the count of changed lines and the count of unchanged lines.
How the two texts are lined up
Both texts are divided at line breaks. The row count equals the longer text's line count, so if the original has 12 lines and the revision has 15, rows 13 to 15 show the revision's extra lines as added. If the original is longer, the surplus rows at the bottom are marked removed. A trailing line break at the end of a paste creates one final empty line, which can show up as an added or removed row on its own.
Within the shared rows, each pair is compared as whole strings. Identical pairs are marked same and everything else is marked changed. Because browsers normalise the line breaks inside a text box to a single line-feed character, pasting a Windows file on one side and a Unix file on the other does not by itself produce differences.
Why one inserted line can mark everything below it as changed
Suppose you add a heading at the top of a 20-line list and compare it with the original. Line 1 of the revision is the new heading, so it is compared with the original's first item and marked changed. Line 2 of the revision is the original's first item, now compared with the original's second item, and so on down the list. The summary will report 20 changed lines even though only one line is new.
A conventional diff avoids this by finding matching runs of lines and reporting only the changes needed to turn one file into the other, which is how the POSIX diff utility is specified. This tool does not do that. When you expect insertions or deletions, compare the text in sections, remove the inserted lines before comparing, or use a version-control diff for source code. When line counts match, position alignment gives exactly the answer you want.
What counts as a difference
Letter case matters: Apple and apple are different lines. Whitespace matters: a trailing space, a double space between words, or a tab where the other text has four spaces all produce a changed row. Invisible characters matter too, including non-breaking spaces copied from web pages and look-alike Unicode characters such as a Cyrillic a in place of a Latin a.
That strictness is useful when you are checking data, where a stray space in an email address or a code is a real defect. It is less helpful for prose, where a paragraph pasted as one long line will be marked changed for a single edited word, with no indication of which word moved.
- Same: both lines are identical character for character
- Changed: both texts have a line at this position but the lines differ
- Added: only the revision has a line at this position
- Removed: only the original has a line at this position
Limits to know before you rely on it
- Lines are compared by position only. One inserted or deleted line shifts every line below it, so those lines are reported as changed even when their text is identical.
- There is no word-level or character-level highlighting. A long paragraph on one line is marked changed as a whole.
- The comparison is exact: letter case, trailing spaces, tabs versus spaces and invisible characters such as non-breaking spaces all count as differences.
- Results are shown on screen only. There is no copy, download or share button for the comparison.
- Every line becomes a rendered row, so a text of ten thousand lines or more can make the page slow on a device with little memory.
Questions people ask about the Text Compare
Does the comparison ignore capitalisation or extra spaces?
No. Each pair of lines is compared character for character, so a different letter case, a trailing space or a tab instead of spaces marks the row as changed. If you want to ignore case, run both texts through the Case Converter first and compare the results.
Why do all my lines show as changed after I added one line at the top?
Because rows are matched by line number. The inserted line pushes every following line down one position, so each is compared with a different line of the original. Remove the inserted line, or compare the text below it as a separate block, and the rest will match again.
Can I compare source code or configuration files?
Yes, as plain text. The tool works well for files where a value changed on an existing line, such as an .env file or a settings file. For code with added or removed lines, a version-control diff such as git diff will give a clearer picture because it aligns matching lines rather than positions.
Does it show which words changed inside a line?
No. A changed row shows the complete original line and the complete revised line next to each other, and you read the difference yourself. Splitting long paragraphs so that each sentence is on its own line makes changes easier to spot.
What do added and removed mean in the row list?
Added means the revision has a line at a position where the original has run out of lines, so the revision is longer. Removed is the reverse: the original has a line at a position beyond the end of the revision. Both appear only in the rows after the shorter text ends.
Is my text uploaded anywhere?
No. Both texts stay in the page and the comparison is calculated by JavaScript in your browser. Nothing is sent to a server or stored, and both boxes are empty again when you reload the page.
Sources and further reading
- The Open Group Base Specifications (POSIX), diff utility: how a conventional line-based diff reports the line changes needed to turn one file into the other, which this position-based comparison does not do
- WHATWG HTML Living Standard, the textarea element: line breaks in a text box are normalised, which is why Windows and Unix line endings alone do not produce differences
- MDN Web Docs, String.prototype.split(): how the text is divided into lines before the rows are compared