Skip to content

Free online tool

Text compare

Paste the original text on one side and the changed version on the other to see, line by line, what was added and removed, with the changed words marked. You can ignore changes in case or spacing. The comparison runs in your browser, so private drafts and code stay on your device.

Runs in your browser. Your text is never uploaded.

Up to 10,000 lines and 500,000 characters in each box. Compared in your browser: nothing is uploaded or saved.

Options

Differences

Paste or type text in both boxes to see what changed.

How to compare two texts

  1. 1Paste the original text into the first box.
  2. 2Paste the changed version into the second box. The comparison appears below and updates as you edit.
  3. 3Read the changes: added lines are marked + and removed lines −, with their line numbers in each version, and the words that changed in an edited line are highlighted.
  4. 4Turn on Ignore case or Ignore spacing changes to hide differences you don’t care about, and open the folded lines to see more.

Features

  • Line-by-line comparison that finds the fewest lines added and removed, whenever they total up to 1,000
  • The words that changed in an edited line highlighted, and changes in spacing shown with visible marks
  • Added and removed lines marked with + and −, not only by colour, with line numbers for both versions
  • Counts of lines added, removed and unchanged, and options to ignore case and spacing changes
  • Long runs of unchanged lines folded away, so the changes stand out
  • Free and private, for up to 10,000 lines a side, compared in your browser

How the comparison works

Here is exactly how the two texts are compared. Everything happens in your browser.

Lines
Windows (CR LF), old Mac (CR) and Unix (LF) line breaks are all recognised, and so are the line and paragraph separators (U+2028, U+2029) that InDesign, Word and some PDFs use, vertical tabs, form feeds and NEL. A line break at the very end of the text doesn’t start an extra, empty line. The two texts can use different kinds of line break and still match, and lines that look the same match even if an accent is stored differently (é as one character, or as e plus an accent). Nothing is compared until both boxes have text.
Finding the changes
Lines both texts start and end with are matched first. For the rest, the Myers diff algorithm finds the fewest lines to remove and add, if they total no more than 1,000. Where lines changed, the removed lines are listed before the added ones. A run of more than 400 removed or added lines shows its first and last 100 and folds the rest, so the lines after it are near.
Changed words
In a change of one removed and one added line, the two are paired. In a longer change, each removed line is paired with the added line it has the most words in common with, keeping both in order, and lines with less than half their text in common aren’t paired. In a change of more than about 50 lines each way, a line is only paired with one near the same place, and in a very long change, such as one of more than about 1,200 lines each way, the first removed line is paired with the first added line, the second with the second, and so on. The two lines of a pair are split into words, runs of spaces and single punctuation marks (each Chinese or Japanese character is a word of its own), and compared the same way as lines, with the same options. The words only one line has are highlighted, unless the two lines have less than half their text (not counting spaces) in common. In a very long line that is too different to compare word by word in full, a stretch with several changes may be highlighted as one. A change in spacing alone is shown as · for a space, → for a tab and ° for a non-breaking space.
Very different texts
To keep the page responsive, a stretch where more than 1,000 lines would have to be removed and added is split at lines that appear once in each text, and the pieces are compared one by one. That can list more changes than the fewest, and the page doesn’t say so. Without such lines, the stretch is compared a part at a time, which can pass over a line both texts have, and if even that would take too long, what’s left is shown as a block removed and a block added. The page says the comparison was simplified when, in a stretch handled either of those ways, a removed line is the same as an added one: the result may then hide lines the two texts share. When none is, that stretch already has the fewest changes.
Options
Ignore case compares lines without regard to upper and lower case. Ignore spacing changes ignores spaces at the start and end of lines and treats any run of spaces or tabs as one space. Unchanged lines are shown as they are in the changed text.
Limits
Each box takes up to 10,000 lines and 500,000 characters (counted as UTF-16 code units, so some emoji count as two).

Private by design

Your text stays with you

Everything runs in your browser. Nothing you type or paste is uploaded, logged or used for analytics, so it’s safe for code, contracts and private notes.

Works with any language

Accented letters, other scripts and emoji come through intact, and Windows, Mac and Unix line breaks are all understood.

Fast with long texts

Results update as you type. Long pastes are handled once you pause, so typing never stutters.

Frequently asked questions

How does the comparison work?

Both texts are split into lines, and the tool finds the fewest lines to remove from the original and add to reach the changed version, using the Myers diff algorithm, the method Git uses by default. Lines both versions share are shown as unchanged. When more than 1,000 lines would have to be removed and added, the texts are compared in pieces to keep the page fast, so the result can list more changes than the fewest.

Why is a changed line shown as removed and added?

The comparison works on whole lines, so a line with one edited word shows as the old line removed and the new line added. Each removed line of a change is paired with the added line most like it, keeping their order, so a line added or deleted next to an edited one doesn’t throw the pairs off, and in each pair the words that changed are highlighted. Lines with less than half their text in common are shown without highlights, as almost everything in them changed.

Two lines look the same but are marked as changed. Why?

They differ in spacing you can’t see: a space at the end of the line, a tab, or a non-breaking space. The change is marked · for a space, → for a tab and ° for a non-breaking space, and Ignore spacing changes hides it. Accents stored in different ways, such as é as one character or as e plus an accent, already count as the same.

How much text can I compare?

Each box takes up to 10,000 lines and 500,000 characters, enough for a long report or a large source file. The limits keep the page responsive. Texts so different that they would take too long to compare in full are compared in pieces, so the result can list more changes than the fewest. When part of it had to be simplified, the page tells you if it may hide lines the two texts share.

What do Ignore case and Ignore spacing changes do?

Ignore case treats “Hello” and “hello” as the same line. Ignore spacing changes ignores spaces at the start and end of lines and treats several spaces in a row as one, which helps when only indentation changed. Windows and Unix line breaks are always treated as the same.

Is my text uploaded or stored?

No. Everything happens in JavaScript in your browser, and your text is never sent to a server, logged or tracked. You can check by opening your browser’s network tab while you type. This tool doesn’t save your text either: it’s gone when you close or reload the page.

Is it free?

Yes. There’s no sign-up, paid plan or adverts, and no limit on how often you use it. Everything runs on your own device, so there are no servers to pay for.

More free text tools

Looking for something else? Browse all free tools.