Text Diff Checker

Compare two texts and see every line and word that was added, removed or changed, side by side or inline.

11 lines
12 lines

Differences

+ 5 added− 4 removed7 unchanged

1
−Shopping list for Saturday
1
+Shopping list for Sunday
2
 
2
 
3
2 pints of semi-skimmed milk
3
2 pints of semi-skimmed milk
4
−1 sliced white loaf
4
+1 sliced wholemeal loaf
5
−6 free range eggs
5
+12 free range eggs
6
Cheddar, mature
6
Cheddar, mature
7
Tea bags (80)
7
Tea bags (80)
8
−Digestive biscuits
8
+Chocolate digestive biscuits
9
Washing up liquid
9
Washing up liquid
10
+Kitchen roll
10
 
11
 
11
Pick up the parcel from the post office before noon.
12
Pick up the parcel from the post office before noon.

Paste the original text on the left and the changed version on the right. The differences appear underneath as you type: removed lines in pink with a minus, added lines in green with a plus, and the exact words that changed picked out within each line.

The comparison runs entirely in your browser. Neither text is uploaded, stored or added to the share link, so it is safe to use for contracts, unpublished drafts and private code.

How to read the result

The checker compares the two texts line by line, then looks inside each changed line to find the words that differ. The numbers in the margin are line numbers in the original and in the changed text, so you can find the same spot in your own document.

  • Pink line with a minus: this line is in the original but not in the changed text.
  • Green line with a plus: this line is only in the changed text.
  • A pink line opposite a green one: the line was edited. The darker highlights are the words that were taken out and put in.
  • No colour: the line is the same in both.
  • Show unchanged lines: long runs of matching lines are folded away, leaving three lines of context around each change. Click the fold to open it, or switch off Fold unchanged to see everything.

Side by side or inline

Side by side puts the original on the left and the changed text on the right with matching lines level with each other. It is the easier layout for prose and for edits within lines, because you can read across.

Inline stacks everything in one column, with removed lines directly above the lines that replaced them. This is the layout used by Git and most code review tools, and it copes better with long lines. On a phone the result is always shown inline, because two columns of text do not fit.

Ignoring case and whitespace

Some differences are noise. Two options let you switch them off so the real edits stand out.

  • Ignore case treats capital and small letters as the same, so Hello and hello match.
  • Ignore whitespace ignores spaces and tabs at the start and end of a line, and treats any run of spaces or tabs inside a line as a single space. Re-indented code and text with trailing spaces then count as unchanged. Removing the space between two words entirely still counts as a change.
  • Line endings never count. A file saved on Windows (CRLF) and the same file saved on a Mac or Linux (LF) compare as identical. If the only difference is that one text ends with a line break and the other does not, every line still matches: the result says so, and Copy patch includes it.

Copying the result as a patch

Copy patch puts the differences on your clipboard in unified diff format, the plain-text format produced by git diff and understood by the patch command and by most code review tools. Lines starting with a minus were removed, lines starting with a plus were added, and each @@ header says where in the two texts the section sits.

The patch always describes the exact texts, so the ignore options do not affect it. It is handy for sending someone a precise list of edits in an email or a ticket without attaching both versions.

What people use a diff checker for

Anywhere there are two versions of something and the question is what changed between them.

  • Checking what a supplier, client or solicitor changed in a contract or set of terms before you sign
  • Comparing two drafts of an essay, article or CV to see which edits were made
  • Spotting the difference between two configuration files, one of which works
  • Reviewing a change to code or a SQL query outside of version control
  • Confirming that two exports, lists or sets of data really are identical

Frequently asked questions

Is my text uploaded anywhere?
No. The comparison is done by your own browser and neither text leaves your device. The share link carries only your layout and ignore settings, never the text itself.
How do I compare two Word documents or PDFs?
Select all the text in each document, copy it, and paste one into each box. Formatting such as bold, fonts and images is not compared, only the words.
Why is a whole paragraph marked as changed when I only edited one word?
The comparison works on lines, and a paragraph with no line breaks in it is a single line. The paragraph is shown as changed, and the darker highlight within it shows the word you edited.
Why are some changed lines not highlighted word by word?
Word highlights are only shown when the two lines are recognisably the same line edited. If a line was replaced with something mostly different, or is over 1,000 characters long, it is shown as one line removed and one added.
Is there a size limit?
There is no fixed limit. Texts of many thousands of lines compare in well under a second when they are mostly alike, and large comparisons run in the background so the page never freezes. Two very large texts with almost nothing in common can take too long: the checker gives up after about eight seconds and asks you to compare a smaller section. Very long results are shown 2,000 rows at a time.
What is the difference between a diff and a patch?
A diff is the list of differences between two texts. A patch is that list saved in a standard format, so a program can apply the same edits to another copy of the original.

More bits and bobs