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.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use Cosine Similarity Calculator online
- Type vector A. Numbers with commas or spaces.
- Type vector B. Same number of entries.
- Pick the decimals. Up to twelve.
- 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?
Can the similarity be negative?
Why must both vectors have the same length?
Does vector length matter?
Can I compare text with this?
Can anyone see the text I put into the Cosine Similarity Calculator?
How do I keep the result of the Cosine Similarity Calculator?
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.