Toolvito

Works on this device

Document Overlap Calculator

Paste or open two texts, or up to twenty, to see how much of their wording they share. The overlap is measured with shingles, short runs of words or characters, and the shared passages are marked.

Enter your values

Shared shingles, Jaccard similarity, containment and cosine similarity, with the shared passages marked.

Your values

Type, paste or open the first text. It is compared on this device and is not uploaded.

3 to 5 words, or 4 to 8 characters, are common choices. Larger shingles find only longer shared passages.

For example a full-width A and A, or the ligature fi and the letters fi.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Compare.

How to use this calculator

  1. Choose Overlap between two texts or Overlap among several texts.
  2. Paste the texts, or open text, Word .docx or PDF files with real text.
  3. Choose word or character shingles and their size. Three to five words find shared phrases; four to eight characters also catch small changes in spelling.
  4. Choose how the texts are prepared, then choose Compare.

How the overlap is measured

  • Preparation: both texts get the same steps: Unicode NFKC (so a full-width A and A match), small letters, punctuation turned into spaces, and each run of white space made one space. You can switch the first three off.
  • Shingles: every run of k words (or k characters) in a row. Each text gives the set of its different shingles.
  • Jaccard similarity = shared shingles ÷ shingles found in either text. 1 means the same set, 0 means nothing shared.
  • Containment of A in B = shared shingles ÷ shingles of A. It shows how much of a short text is inside a longer one, which Jaccard hides.
  • Cosine similarity of word counts = Σ a·b ÷ (√Σa² × √Σb²), where a and b count how often each word appears. It ignores word order. The Cosine Similarity Calculator works on any vectors of numbers.
  • Shared passages: the longest runs of words (or characters) covered by shingles that the other text also has. They are listed in a table for each text, and they are highlighted and underlined in a copy of each text (after preparation). Copy and the CSV file give that copy as plain text without marks; the tables give the place and length of each passage.

Worked example

Text A: "The quick brown fox jumps over the lazy dog. It was a sunny day, and the fox was very happy." Text B: "On a sunny day the quick brown fox jumps over a sleeping dog, and the fox was very happy indeed!"

With 3-word shingles, A has 18 different shingles and B has 18. They share 9, so the Jaccard similarity is 9 ÷ 27 = 0.333333 and the containment of A in B is 9 ÷ 18 = 0.5. The shared passages in A are "the quick brown fox jumps over" and "a sunny day and the fox was very happy": two shared runs that touch ("a sunny day" and "and the fox was very happy") show as one passage.

Limits you should know

  • This page compares only the texts you give it. It does not search the web, a library or past work, so it is not a plagiarism checker, and it cannot tell who copied whom.
  • Overlap in wording is not the same as the same meaning. Two texts that say the same thing in other words get a low score.
  • Common phrases (such as "on the other hand") are shared by many texts that have nothing else in common. Larger shingles reduce this.
  • Scanned PDF pages are pictures and are not read. Texts of up to 500,000 characters are compared.

Related tools