Text Compare (Diff Checker)
Paste two versions of a text to see exactly what changed.
How it works
The tool compares the two texts line by line and finds the longest run of lines they share. Lines only in the original are shown in red with a minus, lines only in the changed text in green with a plus.
Uses
- Check what an editor changed in your document
- Compare two versions of a config file or code snippet
- Spot differences between copied text
FAQ
Is anything uploaded?
No. Everything happens in your browser and nothing is sent to a server.
Comparing two texts
- Paste the earlier version into Original and the newer version into Changed.
- Decide whether small differences should be ignored: "Ignore case" treats upper and lower case as the same, and "Ignore whitespace" collapses runs of spaces and tabs into one space and trims the line ends before comparing.
- Press Compare. The result is only produced when you press the button; editing the boxes does not update it automatically.
- Read the summary, such as "3 added, 1 removed". Lines with a green "+" exist only in the changed text, lines with a red "-" exist only in the original, and unmarked lines are the same in both.
How the comparison is calculated
Each text is split into lines, and the tool finds the longest common subsequence of lines: the largest set of lines that appear in both texts in the same order. It builds a table of these lengths and then walks through it to decide, line by line, whether to keep a shared line, mark one as added or mark one as removed. Everything outside the shared lines is reported as a change.
This is a line-based comparison. If you edit a single word inside a line, the old line is shown as removed and the new line as added; the tool does not highlight the individual word. A modified line is therefore always shown as a minus and plus pair.
When the ignore options are on, the comparison uses normalised copies of the lines, but the output always displays your original text, so you can still see the real spacing and capitalisation.
Worked example
Original:
Dear Sam, / Please send the report by Friday. / Thanks, / Alex
Changed:
Dear Sam, / Please send the report by Monday. / Thanks, / Alex
"Dear Sam," "Thanks," and "Alex" are shared, so they appear unmarked. The Friday sentence is shown with a minus and the Monday sentence with a plus: "1 added, 1 removed". If the only change were a capital letter, ticking Ignore case would turn the result into "The texts are identical."
Common uses
- Seeing what an editor or colleague changed in an article, contract clause or email draft.
- Checking two copies of a configuration file or code snippet for a stray difference.
- Confirming that two lists or exports you expected to match really do.
- Finding where a pasted copy of a text diverged from the source.
Tips and limits
- Differences caused by line wrapping can look bigger than they are. If one version has hard line breaks in the middle of paragraphs and the other does not, nearly every line will differ. Put paragraphs on a single line in both before comparing.
- Ignore whitespace helps with indentation changes and trailing spaces, but blank lines still count as lines.
- Moved blocks are shown as a removal in one place and an addition in another, since the comparison only follows order.
- There is a size guard: the number of original lines multiplied by the number of changed lines may not exceed six million, which is roughly 2,400 lines each. Larger inputs show a message instead of a result. Split a very long document into sections and compare them one at a time.
- Line endings of both Windows and Unix style are handled, but a stray carriage return could make otherwise equal lines differ, so use Ignore whitespace if you suspect that.
More questions
Why does a one-word change mark the whole line?
The comparison works on whole lines. Splitting your text into shorter lines, for example one sentence per line, makes the changes easier to pinpoint.
What does "The texts are identical" mean exactly?
With the chosen options applied, every line matched. With ignore options on, the texts can still differ in capitalisation or spacing.
Can it compare files?
Not directly. Open the file in a text editor, copy the contents, and paste them into the boxes.