How to Compare Two Texts
Paste the older version into the left box, or click Open file to load a text file.
Paste the newer version into the right box.
Differences appear below. After the first comparison, the result updates as you edit either text.
Reading the result
- Red lines marked − are only in the original text: they were deleted or replaced.
- Green lines marked + are only in the changed text: they were added or are the replacement.
- On edited lines, the exact words that changed are highlighted in a stronger colour. When a line was rewritten almost completely, the whole line is marked instead, because word highlights would be noise.
- Line numbers belong to each text, so you can find the same place in your own file.
- Show only changes hides long stretches that are the same and keeps three lines around each change. Click the grey bar to reveal the hidden lines.
- Side by side puts the two versions next to each other. Inline lists removed lines followed by added lines, which is easier to read on a phone.
The options
What each option ignores
| Option | Treats as the same | Useful for |
|---|---|---|
| Ignore case | Total and TOTAL | Text that was retyped, SQL, headings |
| Ignore whitespace | Spaces or tabs at the start or end of a line, and several spaces in a row | Re-indented code, text copied from PDFs or web pages |
| Ignore blank lines | Empty lines added or removed | Documents where only paragraph spacing changed |
Line breaks from Windows (CR LF) and from Mac or Linux (LF) are always treated as the same, so a file saved on another system does not show every line as changed.
Comparing documents and files
- Plain-text files — .txt, .csv, .json, .xml, .md, subtitles and source code — open directly with the Open file button or by dropping them on a box.
- Word and PDF files are not plain text. Copy the text out of them, or convert them first with Word to Text or PDF to Text. Text taken from a PDF often breaks lines in different places, so turn on Ignore whitespace and Ignore blank lines.
- Download .diff saves the changes in the standard unified diff format used by Git and the
patchcommand. It always describes the exact texts, so the ignore options do not change it.
Frequently Asked Questions
Is my text uploaded anywhere?
No. The comparison is done by JavaScript in your browser. The text you paste or open is not sent to our server or stored, which makes this safe for contracts, code and private documents.
How long can the texts be?
Files up to 10 MB each can be opened, and texts of many thousands of lines compare in a second or two. Very large texts that are almost completely different may take too long; the page then asks you to compare smaller parts.
Can I compare Word or PDF documents?
Yes, by comparing their text. Copy the text out of each document, or convert both to plain text with our Word to Text or PDF to Text converter, and paste or open the results here. Formatting such as bold or fonts is not compared.
What is a .diff file?
A .diff (or patch) file lists the changed lines with a few lines of context, marked with − and +. Developers use it to review changes or apply them to another copy of the file with Git or the patch command.