Compare two texts
Differences highlighted line by line. Free, no upload. 1 GB max · Up to 1 GB · Processed locally, never sent to a server.
Two versions of the same text, and always the same question: what changed. Reading them side by side works on one page, not on a fifteen-page contract sent back by the other side with “a few minor adjustments”. This tool takes the original version on the left and the modified version on the right, then lists the lines that were removed and the lines that were added.
The comparison rests on the longest common subsequence, computed on lines. Everything the two texts share stays in place, indented; the rest appears with a minus sign for the original and a plus sign for the new version. The heading of the result gives the number of lines added and removed, and states explicitly when the two texts turn out to be identical.
Both boxes are filled by pasting: no file import, no account. The calculation runs entirely inside the tab, which has one direct consequence — it eats your own machine’s memory, and a size guard protects the browser against oversized comparisons. The compare button re-runs the calculation as many times as you need.
How to use it
- Paste the original version on the left The left box is the reference: the deletions shown with a minus sign are the lines it holds and the other box does not.
- Paste the modified version on the right The right box supplies the added lines. Swapping the two boxes reverses the reading direction of the entire result.
- Break the text into short lines The comparison works on whole lines: a block pasted in one piece comes back entirely removed and then entirely added, which tells you nothing useful.
- Click Run The result appears under the two boxes, in a scrolling frame whose title carries the count of lines added and lines removed.
- Go through the coloured blocks Shared lines are simply indented; removed and added lines are coloured. A modified line appears twice, once on each side.
The algorithm in use
The two texts are split on line breaks, then the page computes their longest common subsequence by dynamic programming: a table of 32-bit integers of size (n+1) by (m+1) is filled from the end, each cell holding the length of the longest run of shared lines still to come. The path is then walked again from the start to produce the sequence of operations.
The cost is proportional to the product of the two line counts, in time as in memory. A guard refuses the comparison when that product goes past four million, with a message stating that the texts are too long for a line-by-line comparison and putting the limit at roughly two thousand lines each. The limit is on the product: two thousand lines against two thousand pass, five hundred against eight thousand pass too, and the table then occupies about 15 MB. When the two directions are tied, the deletion is emitted before the addition, so a modified line shows up as a line removed followed by the line that replaces it.
Granularity: the line, not the word
Two lines are held to be identical only if their strings match exactly. A comma, a capital or a single space at the end of a line is enough to make the whole line diverge. There is no highlighting of the changed word inside the line, and no option to ignore case or whitespace.
Preparing the text is therefore decisive. A contract pasted as three enormous paragraphs gives three lines and a useless result; the same contract at one clause per line gives a readable comparison where only the clauses that moved stand out. Adding a line break after each sentence before you paste changes everything. Splitting word by word, on the other hand, inflates the table very quickly and runs straight into the guard.
The differences the eye does not see
The most frequent surprise: everything is flagged as changed while the two texts look identical on screen. The cause is almost always an invisible character. The split is made on the line feed alone, so a file saved on Windows keeps a carriage return at the end of every line and, compared against the same text with Unix line endings, diverges everywhere at once.
The same effect comes from a non-breaking space dropped in by a word processor, a curly apostrophe (’) against a straight one ('), an em dash against two hyphens, or a space trailing at the end of a line. Text extracted from a PDF brings its own traps: hyphenation kept from the printed layout, ligatures, line breaks that follow the columns instead of the sentences. When in doubt, run both versions through a plain-text editor before pasting them here.
Where this tool fits, and where it does not
It earns its keep on a contract that came back amended, on two states of a dissertation before and after a supervisor’s reading, on a letter template retouched by a colleague, or when checking that a translation still follows the latest revision of its source.
It fits less well elsewhere. For a Word document, the comparison built into the word processor reads the structure of the file and its tracked changes, both of which copy-and-paste destroys. For code under version control, a dedicated diff shows context and history. For two PDFs, the text has to be extracted first. This tool does not merge either: it shows the gaps without producing a consolidated version.
Frequently asked questions
Why does my whole text come back removed and then re-added?
Because it holds no line break and therefore forms a single line, judged different as one block. Insert a line break after each sentence or each clause, in both boxes, and run the comparison again.
A line where I changed one word is displayed twice.
That is the expected behaviour: the comparison never goes below the line. You see the old version marked with a minus, then the new one marked with a plus, and it is up to you to spot the word that differs.
The message about texts being too long appears. What now?
The product of the two line counts has gone past four million. Compare chapter by chapter, or part by part: two blocks of a thousand lines each go through without difficulty.
The two texts look identical and yet everything is flagged.
Look for invisible characters: carriage returns from a Windows file, non-breaking spaces from a word processor, curly apostrophes, spaces at the end of a line. A pass through a plain-text editor neutralises them.
Can case or punctuation be ignored?
No option allows it, the comparison being strictly literal. If case alone is what you do not care about, put both texts through the site’s case converter in lowercase before pasting them here.
Can the result be downloaded?
There is no export button: the report is shown in a scrolling frame that you can select and copy. The entry left in the local history keeps only the number of lines added and removed, never their content.
Can I compare two versions of a confidential contract here?
Yes: the calculation runs entirely inside the tab. Both boxes are filled by pasting, there is no file import and no account, and neither version is sent anywhere — which is also why the comparison consumes your own machine’s memory rather than a server’s. A fifteen-page contract against its amended version goes through without difficulty, provided each clause sits on its own line.
Is there a character limit on the two texts?
There is no limit on characters, only on lines: the comparison is refused when the product of the two line counts goes past four million. The limit being on the product, two thousand lines against two thousand pass, and so do five hundred against eight thousand, the table then occupying about 15 MB. Very long lines cost nothing extra, since the price is paid per line and not per character.
Can I compare two Word documents or two PDFs with it?
Only by pasting their text in, and that is rarely the best route. For a .docx, the comparison built into the word processor reads the structure of the file and its tracked changes, both of which copying and pasting destroys. For two PDFs the text has to be extracted first, and it usually arrives with hyphenation kept from the printed layout and with line breaks that follow the columns instead of the sentences, which a line-by-line comparison then flags everywhere.
Similar tools
Discover other tools
- Markdown → HTML — Markdown converted to clean, semantic HTML.
- Mortgage calculator — Monthly payment, total cost and amortisation table.
- Extract text from image — OCR on photos, screenshots or scans.
- Sign PDF — Draw your signature and place it on any page.