Text compare · Free · Nothing uploaded

Compare Text

Short answer

To compare text, paste the original in one box and the changed version in the other: every line that differs is marked, with changed words struck through or underlined. This compare also names the hard-to-see differences, a no-break space, a curly apostrophe or a Cyrillic letter, that make identical-looking lines differ.

The example: two versions of opening hours, 82% similar, two of the four changed lines differing only in characters you cannot see.

0 lines0 changed · 0 removed · 0 addedPaste the original and the changed text below, or open a text file into each box.

Nothing typed yet. Both texts are kept in this browser only.

Similarity
–
Lines unchanged
0
Lines changed
0
Lines removed
0
Lines added
0
Hard-to-see differences
0

The differences

The differences appear here, line by line.

Differences you cannot see

Lines that differ only in invisible or look-alike characters are named here.

Compared in this browser. Both texts are kept on this device so they survive a reload, and are never sent anywhere: Clear both removes them.

Paste two versions, or open a file into each box. The differences appear as you type, side by side or in one column, and nothing leaves your browser.

A text compare, or diff, lines two versions of a text up and shows what was removed, added and changed between them. It is exact: any character that differs, including one you cannot see, makes a line different.

  • No sign-up
  • Nothing uploaded
  • Rules stated
  • Works offline
  • Invisible characters named

Key facts

Text compare at a glance
DetailAnswer
PriceFree, no sign-up, nothing to install
ComparesLines, with changed words or characters marked; or running text
Lined up byMyers’ difference algorithm (1986), as in git
Similarity2 × shared characters ÷ all characters
NamedNo-break and zero-width spaces, tabs, BOM, quotes, dashes, look-alike letters
IgnoreCapitals, spacing, blank lines, quotes, accent forms
FilesPlain text, read on your device
Where texts are keptThis browser only

How to compare two texts

Put both versions in, choose how to compare, read the differences.

  1. Put in the original

    Paste the first version into Original text, or open a file into it.

  2. Put in the changed version

    Paste the second version into Changed text, or open a file.

  3. Choose how to compare

    Lines with words marked is the default; characters for codes, running text for re-wrapped paragraphs.

  4. Tick what to ignore

    Capital letters, spacing, blank lines, quotes or accent forms, if they do not matter to you.

  5. Read the differences

    Removed text is struck through, added text underlined, and lines that differ only invisibly are named underneath.

  6. Copy the result

    Copy the differences gives a unified diff, or a word diff for running text.

Who compares texts

Anyone holding two versions of something and needing to know exactly what changed.

  • Writers and editors

    What a co-author or an editor changed in a returned draft, word by word.

  • Contracts and policies

    Whether the clause sent back for signature is the clause that was agreed.

  • Developers

    Two configuration files, two API responses or two log lines, characters marked, and the zero-width space that broke a build named.

  • Data and spreadsheets

    Why two cells that look identical do not match in a lookup: a no-break space or a trailing space, named.

  • Translators

    A source text against its updated version, to translate only what changed.

  • Teachers and students

    Two versions of an essay or an answer, re-wrapped text compared as running text.

  • Security checks

    A web address or a payee name against the real one, look-alike letters named.

  • Subtitles and transcripts

    Two caption files, line by line, after a re-edit.

Why lines that look the same are marked as different

Every text compare marks a line that differs. The question it leaves open is the one people ask most often about the result: why is a line marked when the two versions look exactly the same? The answer is nearly always a character that prints as nothing, or as something you cannot tell apart from the character you expect. A no-break space looks like a space. A zero-width space looks like nothing at all. A Cyrillic а looks like a Latin a in most fonts. A comparison is exact, so to it these are different characters, and the line is different.

This compare does two things about that. In the comparison, a hard-to-see character inside a change is drawn as a small labelled box, NBSP or ZWSP, and a change made only of spaces is drawn as dots. And under Differences you cannot see, every line whose only differences are characters like these is listed, with each character named, its Unicode code point, and where in the line it is.

The characters that make identical-looking text compare as different
CharacterCode pointWhere it usually comes fromShown here as
No-break spaceU+00A0Word processors and web pages, to keep two words on one line (“10 kg”, “Mr Smith”);   in HTML; some phone keyboardsNBSP
Narrow no-break spaceU+202FFrench punctuation spacing, and the space that newer Unicode locale data (CLDR 42, 2022) puts before AM and PM in English timesNNBSP
Zero-width spaceU+200BWeb pages and chat apps, which add it as a place a long word may break; copied in with the textZWSP
Zero-width joinerU+200DInside emoji made of several (a family, a flag), and in scripts such as DevanagariZWJ
Byte order markU+FEFFThe start of a file saved as “UTF-8 with BOM”, as Excel saves CSV UTF-8 and older Notepad saved UTF-8BOM
Soft hyphenU+00ADHyphenation points in typeset text and in text copied out of some PDFsSHY
TabU+0009Indents, and cells copied out of a spreadsheet, which are separated by tabsTAB
Curly quotes and apostrophesU+2018, U+2019, U+201C, U+201DAutoCorrect’s smart quotes in Word, Google Docs and phone keyboards, against straight ' and " from code and plain-text editorsNamed in the list
En dash, em dash, minus signU+2013, U+2014, U+2212AutoCorrect turning a hyphen between spaces into a dash, and typeset numbers using a true minusNamed in the list
A Cyrillic or Greek letter that looks Latine.g. U+0430 а, U+043E о, U+0391 ΑA keyboard left on another language, text recognised from a scan, and look-alike web addresses (homoglyphs)Named in the list
An accent stored as a separate marke.g. e + U+0301File names from older Mac disks and text copied out of some PDFs, which store é as e followed by a combining accentNamed in the list

The example, worked. Press Try an example and two versions of a shop’s opening hours go in. Two lines are visible edits: 5pm became 6pm, and 2pm became 4pm. Two more are marked although they read the same. Line 5, Call us on 020 7946 0000., has a no-break space between 020 and 7946 in the changed text, the kind a word processor puts in a phone number to keep it on one line. Line 6, We’re closed on bank holidays., has a curly apostrophe in the original and a straight one in the changed text. The list names both: the original has a space (U+0020) where the changed text has a no-break space (U+00A0), at character 15.

Whether such a difference matters depends on the text. In a contract or an essay it usually does not, and the Ignore settings below take most of them out. In a password, a product code, a spreadsheet lookup, a line of code or a web address it is exactly the difference that breaks things, and it is the one the eye will never find.

How the two texts are compared: lines, words and characters

Both texts are split into lines. The two lists of lines are lined up with Myers’ difference algorithm, published by Eugene W. Myers in 1986 (“An O(ND) Difference Algorithm and Its Variations”, Algorithmica 1) and the default in git and GNU diff. It finds the longest run of lines the two texts share in order; every other line is removed or added. Of all the ways to explain the difference, it picks one with the fewest lines removed and added.

Where removed and added lines sit together, the compare then decides which of them are the same line, changed. Each removed line is paired with the added line most like it, keeping their order, if the two are at least half the same by characters; the rest stay removed or added. That is why, in the example, Sunday: closed is shown removed rather than changed into the phone number line under it. Inside a changed pair, the words that differ are marked, or the characters, under Compare by:

  • Lines, changed words marked (the default) suits prose and most documents. A word here is a run of letters or digits; a run of spaces and each punctuation mark are separate pieces, so a changed comma is marked on its own.

  • Lines, changed characters marked suits codes, numbers, names and anything where one letter matters: INV-2026-0417 against INV-2026-0471 marks the two digits, not the whole code.

  • Running text, line breaks ignored suits text that was re-wrapped: a paragraph copied out of a PDF, an email or a narrow column breaks its lines in different places, and a line-by-line compare would mark every line. Here line breaks count as spaces and the whole text is compared word by word, removed words struck through, added words underlined.

Each row below was typed into the tool. The result column is the line under the percentage on the board:

How each kind of difference is shown (¶ marks a line break; Ignore settings off unless the row says)
The differenceOriginalChangedResultSimilarityHard to see
A word changedOpen 9am to 5pmOpen 9am to 6pm1 changed · 0 removed · 0 added93%–
A line addedOne ¶ TwoOne ¶ Two ¶ Three0 changed · 0 removed · 1 added70%–
A line removedOne ¶ Two ¶ ThreeOne ¶ Three0 changed · 1 removed · 0 added84%–
A line movedOne ¶ Two ¶ ThreeTwo ¶ Three ¶ One0 changed · 1 removed · 1 added72%–
A line edited, more than half the sameTotal: 40 ¶ Paid in cashTotal: 40 ¶ Paid by card1 changed · 0 removed · 0 added80%–
A line rewritten, less than half the sameTotal: 40 ¶ Paid in cashTotal: 40 ¶ Shipped on Monday0 changed · 1 removed · 1 added38%–
A capital letterCall us todaycall us today1 changed · 0 removed · 0 added92%–
… with Ignore capital lettersCall us todaycall us todayIdentical100%–
Two spaces for oneTwo· spacesTwo spaces1 changed · 0 removed · 0 added95%Named
A space at the end of a lineTotal dueTotal due·1 changed · 0 removed · 0 added94%Named
… with Ignore spacingTotal dueTotal due·Identical100%–
A blank line addedOne ¶ TwoOne ¶ ¶ Two0 changed · 0 removed · 1 added99%–
… with Ignore blank linesOne ¶ TwoOne ¶ ¶ TwoIdentical100%–
A no-break space for a space020 7946 0000020NBSP7946 00001 changed · 0 removed · 0 added92%Named
A zero-width spaceinvoice-2026invoiceZWSP-20261 changed · 0 removed · 0 added96%Named
A tab for a spaceName TotalNameTABTotal1 changed · 0 removed · 0 added90%Named
A curly apostrophe for a straight oneWe’re openWe're open1 changed · 0 removed · 0 added90%Named
… with curly and straight quotes the sameWe’re openWe're openIdentical100%–
An en dash for a hyphenpages 10-12pages 10–121 changed · 0 removed · 0 added90%Named
A Cyrillic а for a Latin aPay to account 1Pаy to account 11 changed · 0 removed · 0 added93%Named
An accent stored two wayscafécafé1 changed · 0 removed · 0 added66%Named
… with accents stored two ways the samecafécaféIdentical100%–

A moved line is removed and added. The rows show it: move One from the top to the bottom and the compare keeps Two and Three in place and shows One removed above them and added below. That is what any order-keeping comparison does, git and Word’s Compare included unless they look for moves separately. For a count of words moved between drafts, the edit counter recognises whole sentences that moved.

What each Ignore setting treats as the same

By default the compare is exact: one character different is a different line. The five Ignore settings each say that a kind of difference does not count. They change only what is treated as the same; the text shown is always your own, unchanged.

What each setting treats as the same
SettingTreated as the sameStill a difference
Ignore capital lettersCall and call, in every alphabet with capitalsAccents: resume and résumé
Ignore spacingTwo spaces and one; spaces at the start or end of a line; a tab and a space; a no-break space and a spaceA space where there was none: data base and database; a zero-width space, which is not a space to Unicode
Ignore blank linesEmpty lines, and lines of nothing but spaces, anywhereWhere a paragraph breaks, if the words moved between lines
Curly and straight quotes are the same‘ ’ and ', “ ” and "Dashes and hyphens, which can change a meaning: 10–12 is a range
Accents stored two ways are the sameé as one character and as e with a combining accent (Unicode NFC normalisation)é and e: those are different letters

On the example, the settings take out exactly the differences they name:

The example compared under each setting
TickedSimilarityChangedRemovedAddedHard to see
None (the default)82%4112
Ignore capital letters82%4112
Ignore spacing83%3111
Curly and straight quotes are the same83%3111
All five Ignore settings83%2110

Ignore spacing removes the no-break space; the quotes setting removes the apostrophe; capital letters change nothing, because none differ. With all five ticked, the two lines left changed are the two real edits to the hours, and Sunday and the parking line are still removed and added.

How the similarity percentage is worked out

The percentage on the board is how much of the two texts is the same, by characters:

Similarity = 2 × shared characters ÷ (characters in the original + characters in the changed text)

It is the ratio Python’s standard difflib library calls ratio(), and it treats the two texts alike: swap them and the figure does not change. Shared characters are those of the unchanged lines and, in a changed line, the characters the two versions have in common in order. Line breaks are not counted, and the Ignore settings apply, so with Ignore capital letters ticked, Call and call share all four. The figure is rounded down, so 100% means identical; a text with only a blank line added reads 99%.

The example’s similarity, line by line
RowOriginal lineChanged lineCharacters, originalCharacters, changedShared
Unchanged11131313
Changed: 5pm to 6pm22282827
Changed: 2pm to 4pm33212120
Removed: Sunday: closed4–1400
Changed: a no-break space54252524
Changed: a straight apostrophe65303029
Added: Parking is free after 6pm.–60260
Total131143113

So the example is 2 × 113 ÷ (131 + 143) = 226 ÷ 274 = 82.5%, shown as 82%. Compared as running text, where the removed and added words are counted rather than whole lines, it is 79%.

Similarity is not a plagiarism score. It measures two texts against each other, in order, character by character. A plagiarism checker searches one text against millions of others and reports matching passages wherever they are. Two essays that say the same thing in different words can be 20% similar here; a text pasted twice in a different order can score low too, because order counts.

Copying the differences, and opening files

Copy the differences puts the comparison on your clipboard as text, in a format other tools read. Compared by lines, it is a unified diff, the format of diff -u and git diff: a line starting - is in the original only, + in the changed text only, and a space means unchanged; each block starts with @@ and the line numbers it covers. The example copies as:

--- Original
+++ Changed
@@ -1,6 +1,6 @@
 Opening hours
-Monday to Friday: 9am to 5pm
+Monday to Friday: 9am to 6pm
-Saturday: 10am to 2pm
+Saturday: 10am to 4pm
-Sunday: closed
-Call us on 020 7946 0000.
+Call us on 020 7946 0000.
-We’re closed on bank holidays.
+We're closed on bank holidays.
+Parking is free after 6pm.

Compared as running text, it is git’s word-diff form instead: removed words in [- -] and added words in {+ +}, in place, as in 9am to [-5pm-]{+6pm+}. With an Ignore setting ticked, the copy shows the comparison as you see it, so it may not apply cleanly as a patch.

Opening files

Each box has its own Open a file button for plain-text files: .txt, .md, .csv, .json, .xml, .html, source code, logs and subtitles. The file is read on your device, as UTF-8 or, if it starts with the marks for it, UTF-16. A file opened here keeps its byte order mark, so a file saved with one and a file saved without compare as different on their first line, and the compare names the BOM, which is the usual reason a desktop diff marks the first line of two identical-looking CSV files.

Line endings are reported, not compared. Windows ends lines with two characters (CR LF), Mac and Linux with one (LF). A text box in a browser turns every line ending into LF as the text goes in, so the compare cannot see them; instead the note under the boxes says which endings the opened file used. Word, PDF and spreadsheet files are not read: copy their text in, or, for a Word file’s tracked changes, use the edit counter, which reads them.

What this compare does not do

What this compare does and does not do
It doesIt does not
Show two texts line by line, side by side or in one column, with changed words or characters markedRecognise a moved line as moved: it is removed in one place and added in another
Name the invisible and look-alike characters that make a line differChange your text: it shows the characters, and you correct them in your own copy
Give a similarity percentage with its formulaCheck for plagiarism against other sources, or judge whether two texts say the same thing in other words
Open plain-text files and report their line endings and byte order markRead Word, PDF or spreadsheet files, compare formatting, or compare images
Copy the result as a unified diff or a word diffMerge the two versions into one, or keep a history of versions
Keep both texts in this browser onlySend your text anywhere, or keep it after you clear it

For counting how much an edit changed, the words kept, cut, added and moved, use the edit counter; for the length of either version, the word counter.

This compare, Diffchecker, Text Compare! or Word

Four ways to compare two versions of a text, and where each stops. The online tools are described from their own pages, read on 30 October 2026.

This compare against Diffchecker, Text Compare! and Word’s Compare
 This compareDiffcheckerText Compare!Word’s Compare
Words or characters markedEither, freeWord and character precision free to try, unlimited on ProCharacter detailWord or character level
Ignore case and spacingFree, plus blank lines, quotes and accentsYesProFormatting and case options
Invisible characters namedNamed, with code pointsNot describedNot describedNo
Similarity percentageYes, formula statedNot describedNot describedNo
Re-wrapped textRunning-text modeLine by lineLine by lineBy paragraph
Where your text goesNowhere: this browser onlyIts page says the comparison runs in your browserIts page says text is sent to its server, encrypted, and not storedYour computer

More writing tools

Every writing tool on the site runs in your browser, needs no sign-up, and sends nothing anywhere.

Format & compare1

Sort, recase and compare text, generate words and format citations.

All 6 writing tools, by category: Counts & lengths (4) · Format & compare (2)

Frequently asked questions

How do I compare two texts for differences?

Paste the original into the first box and the changed version into the second. Every line that differs is marked as you type: removed text struck through, added text underlined, and the changed words highlighted inside each changed line. The board shows how similar the texts are and how many lines were changed, removed and added.

Why does the compare show a difference when the texts look the same?

Because a character that differs may print as nothing, or look like another. The usual ones are a no-break space for a space, a zero-width space, a tab, a curly apostrophe for a straight one, a byte order mark at the start of a file, or a Cyrillic letter that looks Latin. This compare names each one, with its code point and position.

What is the difference between comparing by line, by word and by character?

By line, any change makes the whole line different, and the compare then marks inside it either the words that changed or the characters. Words suit prose; characters suit codes, numbers and names, where one letter matters. Running text ignores line breaks and compares word by word, for paragraphs that were re-wrapped.

Can I ignore whitespace and capital letters when comparing text?

Yes, free. Ignore capital letters treats Call and call as the same. Ignore spacing treats two spaces as one, ignores spaces at the start and end of lines, and treats tabs and no-break spaces as spaces. There are also settings for blank lines, curly and straight quotes, and accents stored two ways. Your text is always shown unchanged.

How is the similarity percentage calculated?

As 2 times the characters the texts share, in order, divided by the characters in both, the ratio Python’s difflib uses. Line breaks are not counted and the Ignore settings apply. It is rounded down, so 100% means identical. The example is 2 × 113 ÷ 274, which is 82%.

Why does a moved paragraph show as deleted and added?

Because the comparison keeps order. It lines up the longest run of lines the texts share in the same order, and a moved line is outside that run, so it shows removed where it was and added where it is. Git and most diff tools do the same. The edit counter on this site recognises whole sentences that moved.

Can I compare two files?

Yes, plain-text ones: each box has its own Open a file button for .txt, .csv, .json, .md, code, logs and subtitles. The file is read on your device. The compare reports the file’s line endings and keeps its byte order mark, which it names. Word, PDF and spreadsheet files are not read; copy their text in.

Is this a plagiarism checker?

No. It compares the two texts you give it with each other, in order, character by character. A plagiarism checker searches one text against millions of others and finds matching passages anywhere. The similarity here says how much of one version survives in the other, not whether either was copied.

What happens to the text I compare?

Nothing leaves your device. The comparison runs in your browser, and both texts are kept in this browser’s storage so a reload does not lose them. Clear both deletes them. On a shared computer, clear the boxes when you finish, as you would close a document.

Open the compare text

Free, no sign-up, and what you enter stays in your own browser.