InputTestHub

Text Compare

Compare two texts and highlight added or removed words, lines and characters. Review edits and cleaning changes with clear comparison options.

Text Nothing uploaded No sign-up Free, unlimited
Text tool
Fill in both boxes to compare them.
In short Paste the original into the first box and the changed version into the second. The comparison marks every added and removed piece — by line, by word or by character — and says whether the texts are identical, where they first differ, and how similar they are. The options decide what counts as a difference: capital letters and spacing can each be ignored. Inside a change, tabs, spaces at the end of a line and invisible characters such as the zero-width space are drawn as visible marks, because those are exactly the differences that make two strings look identical and still refuse to match. Large texts are compared in the background with a Cancel button, so the page never freezes. Nothing is uploaded.

How to use the Text Compare

  1. Paste the original text into the first box and the changed text into the second.
  2. Choose whether to compare by lines, words or characters, and what to ignore.
  3. Read the summary — identical or not, where the first difference is, how similar — then the marked changes below it.
  4. Copy the differences or download them as a .diff file if you need to keep them.

About the Text Compare

The Text Compare tool shows exactly what differs between two versions of a text, and runs entirely in your browser.

Lines, words or characters

Compare by lines for code, configuration files and lists, where a line is the unit that matters. Compare by words for prose, where a one-word edit should not mark a whole paragraph as rewritten. Compare by characters to find a single stray letter, digit or symbol. In line mode on shorter texts, a changed line that pairs with its replacement also has the words that changed marked inside it.

What “different” means is your choice

  • Ignore case treats “Hello” and “hello” as the same.
  • Ignore spacing differences treats a tab and a space as the same and, when comparing by lines or words, a run of spaces as one space and spaces at the ends of a line as nothing.

If two texts match only because something was ignored, the result says so, so a match is never mistaken for byte-for-byte identical.

Line endings. A text box in a web browser converts Windows line endings (CR LF) and old Mac ones (CR) to LF the moment text is pasted, so a file saved on Windows and the same file saved on Linux compare as identical here. If the line ending itself is what you need to check or change, use the Line Ending Converter.

Invisible differences, made visible

Inside every change, a tab is drawn as →, a space at the end of a line as ·, and invisible characters are named in brackets — [ZWSP] for a zero-width space, [NBSP] for a non-breaking space. Characters are compared as they are displayed, so an accented letter written as a letter plus a combining accent counts as one character, and so does an emoji with a skin tone. Differences the eye cannot see are the usual reason two strings that look the same will not match. To remove them rather than just find them, use Text Cleaner, which can send its before-and-after straight back here.

How the comparison works

The tool finds the smallest set of additions and removals that turns the first text into the second — the same goal as the diff programs developers use — with a method in the style of the Myers difference algorithm that keeps memory proportional to the size of the texts. Similarity is twice the unchanged pieces divided by all the pieces in both texts, so identical texts score 100% and texts with nothing in common score 0%. Each text can be up to 500,000 characters. Texts larger than about 20,000 characters together are compared in a background worker with a Cancel button, and a pair that is too different to compare finely is reported rather than left running.

Related tools

Where this tool stops

A comparison tells you what differs, not which version is right or whether a change was intended. Text moved from one place to another appears as a removal where it was and an addition where it is now, because a difference is about order as well as content. Formatting such as bold or fonts is not compared — only the text.

Explained in our guides

All guides

Frequently asked questions

How do I compare two texts?
Paste the original into the first box and the changed version into the second. Every addition and removal is marked straight away, with a summary of how many changes there are and where the first one is.
Why do two texts that look identical show a difference?
Usually an invisible character: a tab instead of spaces, a space at the end of a line, a non-breaking space, or a zero-width character. Changes show tabs as →, trailing spaces as · and invisible characters by name, such as [ZWSP]. Text Cleaner removes the invisible ones.
Should I compare by lines, words or characters?
Lines for code and lists, words for prose, characters when you are hunting a single stray symbol. Word mode is usually the most readable for edited documents.
How is the similarity percentage calculated?
Twice the number of unchanged pieces, divided by the total number of pieces in both texts. The pieces are lines, words or characters depending on what you compare by, so the same pair can score differently in each mode.
Is my text uploaded?
No. The comparison runs in your browser, and large texts run in a background worker on your own device. Nothing is sent anywhere.
Is there a limit on how often I can use the Text Compare?
Free, unlimited, and no email address required. You can use it a hundred times a day and nothing changes.
Does anything I enter leave my computer?
No. The Text Compare runs entirely in your browser using JavaScript. Nothing is transmitted, logged or stored, which you can verify yourself in the Network tab of your browser's developer tools.
What problem does the Text Compare solve?
The jobs it is built for: verifying that a copy-paste transferred everything. Seeing exactly what an editor changed in a draft. Finding the invisible difference that stops two strings matching. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
What are the key numbers for the Text Compare?
Compares by is Lines, words or displayed characters. Largest text is 500,000 characters each. Similarity is 2 × unchanged pieces ÷ all pieces. These are printed on the page itself, so you do not have to take them on trust.
Is there an app version?
Yes. The page is responsive and the utility works in Chrome, Safari, Firefox, Edge and Samsung Internet on both Android and iOS. There is no app to install and nothing to sign into.

Related text tools

All 92
01

Text Diff Checker

Compares two texts and highlights every added, removed and changed line or word, side by side.

02

Word Counter

Counts words, characters, sentences, paragraphs and reading time live as you type, using the…

03

Character Counter

Counts characters with and without spaces and shows live progress against Twitter, SMS, meta…

04

Sentence Counter

Counts sentences in any text and shows average sentence length, longest sentence and how many…

05

Paragraph Counter

Counts paragraphs, shows the word count of each one and flags paragraphs that are too long for…

06

Line Counter

Counts total lines, non-empty lines, duplicate lines and the longest line in any pasted text…

07

Word Frequency Counter

Ranks every word in your text by how often it appears, with stop words removed and one-, two…

10

Syllable Counter

Counts syllables in words, lines and whole texts — useful for haiku, lyrics, poetry metre and…