Skip to content
DeviceCheckHub

Text Compare

Paste two texts, or open two files, and see exactly what was added, removed and changed.

Paste or open a text in each box and the differences appear here. Nothing is uploaded.

How to compare two texts

  1. Paste the first text into Original text and the second into Changed text, or press Open a file above either box to load a text file. Pressing Try an example fills both boxes so you can see how it works.
  2. The differences appear as soon as both boxes have text, and update as you type. Lines only in the original are red, lines only in the changed text are green, and lines that exist in both but differ show the original in red beside the new version in green.
  3. Use Next difference and Previous difference to jump through the changes one by one, which is handy when a long text has only a few edits.
  4. Press Copy differences to copy the result as plain text, with removed lines starting “-” and added lines starting “+”, or Copy share link to send someone a link that opens this same comparison.

How to read the result

Every row has line numbers, one for each text. In side by side view the original is on the left and the changed text on the right, so a line that was only added has an empty, striped space opposite it. In one column view, which suits phones and narrow windows, removed lines are marked with a minus sign and added lines with a plus sign, with the original line directly above its replacement.

Color is never the only signal: each colored line also carries a screen-reader label saying whether it was removed or added, and in one column view the minus and plus signs appear on the page as well. Inside a changed line, the darker patches mark the exact words that were removed or added, so a changed price, date or name stands out from the words around it.

What the options do

Line endings never count as differences, so a file saved on Windows (which ends lines with two characters) and the same file saved on a Mac or Linux machine compare as identical. A single newline at the very end of a text is ignored too.

How the comparison works

The tool finds the longest run of lines the two texts have in common and treats everything else as a difference. It uses the Myers algorithm, the same family of method behind the diff command that programmers have used for decades, so it finds the smallest set of added and removed lines that turns one text into the other. Where a group of removed lines is followed or preceded by added lines, the tool pairs them up in order and compares each pair word by word, which is how it can show a single changed word inside a long sentence.

Because the match is by whole lines, two things are worth knowing. First, if you reflow a paragraph by moving its line breaks, the lines no longer match even though the words are unchanged, so put each paragraph on a single line or turn on Ignore extra spaces. Second, a block that was moved to another place shows as removed in one spot and added in another, because a line comparison can only say what is present in each text, not where a block went.

What people compare

Tips for a cleaner comparison

Your text stays on your device

Documents, contracts and code are often private, so the comparison happens entirely in your browser: nothing you paste or open is sent to this website or anyone else. The page does keep your latest two texts and settings in your browser’s storage on this device so they are still there if you reload; the Clear button removes the texts, and clearing the site’s data in your browser removes everything.

A share link carries the two texts inside itself, compressed, in the part after the # sign. Browsers keep that part to themselves and never send it to a server, and the page takes it out of the address bar as soon as the texts are open, so they aren’t left in your browsing history either. Anyone who has the link can read the texts, so send it only to the people meant to see them.

Related tools: count the words and characters of either text with the word counter or the character counter, tidy capitals with the case converter, or keep notes with the online notepad.

Frequently asked questions

Is my text uploaded or saved on a server?

No. The comparison runs in your browser, so neither text is sent anywhere. To save you retyping, the page keeps your last two texts and your settings on this device only; press Clear to remove the texts.

How do I share a comparison?

Press Copy share link and send the link. Both texts are packed inside the link itself, after the # sign, a part of a web address that browsers never send to a server, so nothing is stored anywhere and the link works for as long as you keep it. Whoever opens it sees the same comparison. Very long texts make links too long for many apps, so for those the page asks you to send files instead.

Why does a paragraph I only reflowed show as changed?

The tool compares line by line, as most text comparison tools do. If you move a line break, the lines on either side of it are no longer the same lines. Turn on “Ignore extra spaces” to skip spacing differences, or put each paragraph on one line before comparing.

Can it tell that a block of text was moved?

Not as such. A block that moved is shown as removed from its old place and added in its new one. That is accurate, but you have to spot the match yourself; the matching words are easy to find because only changes are colored.

How do I compare two lists, such as names or emails?

Put one item on each line. The order matters, so sort both lists the same way first, or the same item in a different position shows as removed and added. Then every item that appears in only one list is highlighted.

What does “Mark changes inside lines” do?

When a line is changed rather than added or removed, the tool colors the exact words that differ, or the exact characters if you choose Characters, so you can see a single changed number or a typo at a glance. Choose Off to color only whole lines. Lines with almost nothing in common are colored as a whole, because scattered fragments would be harder to read.

Is there a size limit?

Each box takes up to two million characters, and a file you open can be up to 2 MB. Very long comparisons fold the unchanged lines away so the page stays fast; press a folded section to open it. If the two texts have thousands of separate differences, the tool says so and shows the middle part as replaced.

Last updated · About DeviceCheckHub