Text Compare

Paste an original and a changed version to see exactly what was added, removed or edited, line by line, word by word or character by character.

100% freeNo sign-upRuns in your browserWorks on mobile

How to use the Text Compare

  1. Paste the original text on the left and the changed version on the right.
  2. Choose to compare by Lines, Words or Characters, and pick the inline or side-by-side view.
  3. Tick Ignore case or Ignore whitespace to hide changes that do not matter to you.
  4. Read the highlighted result: removed text is red and struck through, added text is green.

Features

  • Line, word and character comparison
  • Inline and side-by-side views with line numbers
  • Exact word changes highlighted inside edited lines
  • Ignore case and whitespace options
  • Added, removed and unchanged counts with a similarity score
  • Private: both texts stay in your browser

How the comparison works

The tool uses the jsdiff library, which implements Eugene Myers’ difference algorithm, the same approach behind many version control systems. It looks for the smallest set of insertions and deletions that turns the original into the changed text, then shows everything else as unchanged. Because it only ever reports additions and removals, an edited word appears as the old word removed and the new word added.

Lines, words or characters?

ModeBest forWhat a change looks like
LinesCode, configuration files, lists, CSV dataWhole lines marked, with the exact edit highlighted inside
WordsEssays, articles, contracts, emailsIndividual words and punctuation marked
CharactersShort strings, IDs, typos, passwords you suspect differSingle letters marked

For prose, word mode is usually the most readable, because paragraphs are long lines and a one-word edit would otherwise mark the whole paragraph. In line mode, pairs of changed lines show the specific words that differ, so you get both views at once. Character mode is precise but noisy on long texts.

Inline or side by side

The inline view reads like a marked-up document: removed text in red and struck through, added text in green and underlined, in one column. In line mode it shows original and new line numbers, with a minus or plus sign for each changed line. The side-by-side view puts the original on the left and the changed text on the right, which makes it easier to scan long documents and to see where blocks were inserted. On a phone, inline is easier to read.

For long texts with few changes, tick Only show changed lines. Unchanged stretches collapse to a single row, with two lines of context kept around each change.

Ignoring differences that do not matter

Ignore case treats “Hello” and “hello” as equal. Ignore whitespace ignores extra spaces, tabs, indentation and trailing spaces, which is useful when one version was reformatted or pasted from a different editor. Both options only change what counts as a difference; the text shown is never altered in line mode. In character mode, ignoring whitespace normalizes the spacing of both texts before comparing.

Understanding the numbers

The counts are in the unit you chose: lines, words (including punctuation marks) or characters. Similarity is twice the unchanged amount divided by the total size of both texts, so identical texts score 100% and texts with nothing in common score 0%. The figure depends on the mode, so compare like with like.

Common uses

  • Checking what an editor, colleague or client changed in a contract or article.
  • Comparing two versions of a configuration file or code snippet before deploying.
  • Confirming that two exports or lists really are the same.
  • Reviewing your own revisions before submitting an essay.

Both texts stay in your browser; nothing is uploaded, which matters for contracts and other confidential documents. Formatting a JSON file first with the JSON Formatter makes data comparisons much clearer.

Frequently asked questions

Is my text uploaded to a server?

No. The comparison runs entirely in your browser, so confidential documents never leave your device.

Which comparison mode should I use?

Use Words for normal writing, Lines for code, lists and data files, and Characters for short strings where a single letter matters.

Why is a whole line marked when I only changed one word?

Line mode works line by line, so any edit marks the line as changed. The exact words that differ are highlighted inside it, or you can switch to Words mode.

Can I compare Word or PDF documents?

Copy the text out of each document and paste it into the two boxes. Formatting such as bold or fonts is not compared, only the text.

How is the similarity score calculated?

It is twice the unchanged amount divided by the combined size of both texts, measured in the unit of the current mode. Identical texts score 100%.

More text tools

Other free tools you might need next.

View all 20