The comparison stopped with a message instead of a result when I compared two big files; what should I do?

Switch the comparison level to Lines and try again. The message appears because the comparison runs on the page itself, so it stops after 2.5 seconds when the texts are large and very different, and shows a message instead of a partial result that could mislead you. Line comparison is far faster; if it is still not enough, split the files into parts.

Published · 3 min read

Why it stops

Each comparison level cuts the text into units, then searches for the longest common run between them. In character comparison every character is a unit, so a 200,000-character text means 200,000 units. In words, every word and every space is a unit. In lines, a whole line is one unit, so the count is much smaller. And the more the two texts differ, the longer the search takes.

Because the work happens in your browser rather than on a server, there is a time limit: after 2.5 seconds the comparison stops so the page does not freeze, and a message says the texts are large and very different.

What we saw in a real test

Worked example

Two texts of about 200,000 characters each, random letters in 60-character lines, so different almost everywhere.

Character and word comparison: both stopped and showed the time-limit message.

Line comparison of the same two texts: finished in under a tenth of a second on the test machine, with Added 3,334, Removed 3,334 and Unchanged 0, which is right, since every line really is different.

The tool page also notes that line comparison was tested on two texts of 100,000 lines each with hundreds of edits, and finished in about a second.

What to do, in order

  1. Choose Lines in Text comparison and press Compare. That settles most cases.
  2. If you need to see which word changed inside a line, line comparison already highlights it inside every modified pair, without running word comparison over the whole file.
  3. If the files are completely different, check you are comparing the right two versions. Two texts with nothing in common are not worth diffing.
  4. If you want word or character comparison on a long text, split it into parts, such as one contract clause at a time.

Other messages you may see with big texts

  • When the two texts together pass 20,000 characters, the comparison no longer starts as you type, and a message asks you to press Compare. That is not an error.
  • When the result has more than 2,000 rows, only the first ones are drawn on screen, but the plain-text result, copy and download contain every difference.
  • Pasting a very large text makes the text box itself slow for a few seconds, before any comparison starts.

Do the ignore options help?

Ignoring case and whitespace removes false differences, so the search may get a little shorter if most differences are of that kind. But they do not change the number of units, so do not count on them to fix a size problem. Changing the level is the fix.

Common questions

Are my texts lost when it stops?

No, both texts stay in their boxes, so change the setting and compare again.

Would a faster computer solve it?

It may get further within the same limit, but changing the level is the dependable fix.

Are the files sent to a server to compare?

No, the comparison always runs in your browser, which is why the time limit exists.