Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

Cosine Similarity Calculator

Type two vectors of the same length and see their cosine similarity, cosine distance and angle. The dot product and the lengths are shown, so you can check the steps by hand.

How to use Cosine Similarity Calculator online

  1. Type vector A. Numbers with commas or spaces.
  2. Type vector B. Same number of entries.
  3. Pick the decimals. Up to twelve.
  4. Read the steps. Dot product, lengths, result.

Why use this free Cosine Similarity Calculator

  • Similarity, distance and angle
  • Dot product with its terms
  • Lengths of both vectors
  • Brackets and commas accepted
  • Clear errors
  • Runs in your browser

What the number means

Cosine similarity compares the direction of two vectors and ignores how long they are. It runs from minus one for opposite directions, through zero for directions at a right angle, to one for the same direction. It is widely used to compare embeddings of text and other data.

The formula

The dot product of the two vectors is divided by the product of their lengths. The dot product is the sum of the products of matching entries, and the length is the square root of the sum of the squares. The page shows the dot product with its terms, both lengths, and the formula, so each step can be checked.

Distance and angle

The cosine distance is one minus the similarity, which is zero for the same direction and grows as the vectors drift apart. The angle is the inverse cosine of the similarity, given in degrees. Both are shown with the number of decimals you choose.

Entering vectors

Separate the numbers with commas, spaces or semicolons. Square brackets are allowed, so a vector copied from code works. Both vectors must have the same number of entries, and a vector of only zeros has no direction, so the page tells you the answer is undefined.

Limits

Vectors of up to five thousand numbers are accepted, and the maths runs in your browser. With very large embeddings, rounding in floating point can move the last digits. The tool does not make embeddings from text; paste the numbers you already have.

Using the tool

As you type in the Cosine Similarity Calculator, the result appears at once. Undo and redo step back through your earlier text.

Cosine Similarity Calculator: frequently asked questions

Is a result of zero the same as unrelated?
It means the vectors are at a right angle. For embeddings, treat it as a sign of little shared direction.
Can the similarity be negative?
Yes, down to minus one when the vectors point in opposite directions.
Why must both vectors have the same length?
Entries are matched one to one, so a missing entry would leave the sum undefined.
Does vector length matter?
No. Doubling a vector does not change the similarity.
Can I compare text with this?
Only after you turn the text into numbers with an embedding model of your own.
Can anyone see the text I put into the Cosine Similarity Calculator?
No. The Cosine Similarity Calculator works in your browser, and nothing is uploaded.
How do I keep the result of the Cosine Similarity Calculator?
Yes. Use the copy button on the Cosine Similarity Calculator result, or select it and copy it by hand.

Related searches for Cosine Similarity Calculator

  • Cosine Similarity Calculator online
  • free Cosine Similarity Calculator
  • Cosine Similarity Calculator online free
  • Cosine Similarity Calculator for mobile
  • Cosine Similarity Calculator without sign up
  • cosine similarity formula
  • cosine similarity calculator with table
  • Cosine Similarity Calculator – Text & Writing Tools

Cosine Similarity Calculator is a free online tool on MAITBOX, in the Text & Writing Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.

More tools in Text & Writing Tools →

Search tools