Skip to content

Text compare: find the differences between two texts

Paste an old and a new version of any text, a contract, an essay, a list or a piece of code, and see exactly what was added, removed or changed. Changed lines are matched up and the changed words inside them are highlighted. Arabic and English work side by side, and nothing is uploaded.

Quick answer

To compare text, paste the original in the first box and the changed version in the second. Added lines show in green, removed lines in red, and changed words are highlighted inside each line. Switch to Word by word for prose, choose Side by side or Inline, and tick options to ignore case, extra spaces or Arabic tashkeel.

Compared on your device. Nothing is uploaded or saved.

How to use the Text Compare

  1. Paste or open the original text in the first box and the changed text in the second.
  2. Choose Line by line for code, lists and documents, or Word by word for running prose. For lines, choose Side by side or Inline, and tick Show only changes for long texts.
  3. Read the summary of added, removed and changed lines, then copy or download the differences.

How the comparison works

The tool uses the difference algorithm published by Eugene Myers in 1986, the same approach behind many version control and diff programs. It finds the smallest set of lines to delete and insert to turn the first text into the second, so unchanged lines line up even when a paragraph has been added in the middle. Where a removed line and an added line sit at the same spot, they are paired as a change and compared again word by word, so you see that "500 AED" became "650 AED" instead of a whole red line and a whole green line.

Line by line or word by word

Line by line suits anything where lines matter: code, CSV rows, configuration files, lists of names, subtitles and contracts with numbered clauses. Word by word suits essays, letters and articles where a sentence may have been re-wrapped across lines; it compares the whole text as one stream of words and shows deleted words struck through and new words underlined in place.

Ignoring case, spaces and tashkeel

Ignore case treats "Dubai" and "DUBAI" as the same. Ignore whitespace treats runs of spaces and tabs as one space and skips spaces at the start and end of a line, which helps with text copied from PDFs or re-indented code. Ignore Arabic diacritics compares "مُحَمَّد" and "محمد" as equal, useful when one copy of a text has tashkeel and the other does not. The highlighting still shows the text as you typed it.

Arabic and mixed-direction text

Each line is shown with its own direction, so an Arabic line reads right to left and an English line left to right in the same table. Words are split at spaces and punctuation, including the Arabic comma and question mark, and a word keeps its vowel marks, so a change of a single haraka is shown on the right word. On the Arabic version of this page the original text sits on the right and the changed text on the left, as an Arabic reader expects.

Saving the result and privacy

Download changes.diff to keep a record of a line comparison in the unified diff format that Git and most code tools read, with three lines of context around each change. A word comparison downloads as a text file with removals in [- -] and additions in {+ +}. The comparison runs entirely in your browser, which matters for contracts, HR letters and unpublished work: nothing is uploaded or stored.

Frequently asked questions

How do I use text compare to find the differences between two texts?

Paste the first text in the Original box and the second in the Changed box. The differences appear below at once: green for added, red for removed, with the changed words highlighted.

Is there a limit on how long the texts can be?

There is no fixed limit. Documents of thousands of lines compare in a moment. If two very long texts have almost nothing in common, the tool marks the differing part as replaced instead of searching line by line.

Can I compare two Word or PDF files?

Copy the text out of each file and paste it in. For plain text files such as .txt, .csv, .json or code, use the Open button above each box.

Why does a line show as changed when it looks the same?

It probably differs in spaces, tabs, letter case or invisible characters. Tick Ignore whitespace or Ignore case, or for Arabic Ignore diacritics, and compare again.

Are the texts I compare saved anywhere?

No. The comparison happens in your browser and nothing is uploaded. Closing the tab removes both texts.