Skip to content

Menu

Vector Similarity Calculator

Calculate cosine/euclidean similarity between vectors

Runs entirely in your browserAIFree, no sign-up
Loading tool

01What is Vector Similarity Calculator?

When a RAG retriever returns the wrong chunk, you often end up staring at two embeddings and asking how close they really are. Paste both vectors here and you get four measures side by side, each shown to six decimal places. Cosine similarity is the dot product divided by the product of the two vector lengths. It runs from -1 to 1 and ignores magnitude, so it only cares about direction. A marker on a -1 to 1 scale shows where your result lands, and a short label reads it for you. Above 0.95 is "Nearly the same direction", above 0.8 is "Very similar direction", above 0.5 is "Somewhat similar" and above 0.2 is "Weakly aligned". Above -0.2 counts as "Close to orthogonal", and anything lower is "Pointing in opposite directions". The other three are standard too. Euclidean distance is the straight-line (L2) distance. The dot product is the raw inner product. Manhattan distance is the sum of absolute differences (L1). A small example makes the difference clear. Take A = 1,2,3 and B = 2,4,6. B is just A doubled, so cosine is exactly 1.000000. The distances are not zero though: Euclidean is 3.741657, Manhattan is 6 and the dot product is 28. That gap is why cosine and Euclidean can disagree about which neighbor is "closest". Input is forgiving. Numbers can be separated by commas or spaces, and outer square brackets are stripped, so a Python list or JSON array pastes straight in. Anything that is not a finite number, such as a stray word or Infinity, marks that vector as not valid. The dimension count appears above the results, and vectors of different lengths get a dimension mismatch message. If either vector is all zeros, cosine is undefined, and the tool shows "n/a" instead of a misleading 0. For cosine, each vector is first scaled by its largest absolute value, which keeps huge or tiny numbers from overflowing. The result is also clamped to the -1 to 1 range. Euclidean distance is scaled the same way, so 1e200,0 against 0,1e200 gives about 1.414e200. The dot product of values that big is too large for a JavaScript number and shows as Infinity. Real embeddings always are. Everything runs in your browser.

Developers building semantic search or RAG pipelines who need to check, by hand, how two embedding vectors compare. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Vector Similarity Calculator

  1. Paste the first vector into Vector A and the second into Vector B. Commas, spaces and outer brackets all work.
  2. Or click an example: Identical vectors, Orthogonal vectors or Similar embeddings.
  3. Check the dimension count. A mismatch message means the vectors have different lengths.
  4. Read Cosine Similarity with its label and the scale marker, then Euclidean Distance, Dot Product and Manhattan Distance.
  5. Click the reset button to restore the sample vectors.

03Worked examples

Input: A = 1,2,3 B = 2,4,6
Result: Cosine 1.000000, Euclidean 3.741657, Dot 28.000000, Manhattan 6.000000
B is A doubled, so the direction matches exactly while the distances do not.
Input: A = 1,0 B = 0,1
Result: Cosine 0.000000, Euclidean 1.414214, Dot 0.000000, Manhattan 2.000000
Perpendicular vectors, labelled Close to orthogonal.
Input: A = 1,1 B = -1,-1
Result: Cosine -1.000000, Euclidean 2.828427, Dot -2.000000, Manhattan 4.000000
Labelled Pointing in opposite directions.
Input: A = [0.1, 0.2, 0.3] B = 0.1 0.25 0.28
Result: Cosine 0.990727, Euclidean 0.053852, Dot 0.144000, Manhattan 0.070000
Brackets, commas and spaces are all accepted.
Input: Similar embeddings example (8 dimensions)
Result: Cosine 0.999386, Euclidean 0.060828, Dot 2.045000, Manhattan 0.170000
The built-in example, labelled Nearly the same direction.
Input: A = 0,0 B = 1,1
Result: Cosine n/a, Euclidean 1.414214, Dot 0.000000, Manhattan 2.000000
Cosine is undefined for a zero-length vector, while the distances still compute.

04Common use cases

  • Comparing two sentence embeddings while debugging why a RAG retriever picked the wrong chunk
  • Checking why a vector database returned an unexpected nearest neighbor under cosine versus L2 distance
  • Testing if your embeddings are unit length by checking that dot product and cosine match
  • Verifying a hand-written cosine function in Python or SQL against a known result
  • Showing students how a scaled copy of a vector has cosine 1 but a non-zero distance
  • Spot-checking that two vectors came from the same model by confirming the dimension counts match

05Tips

  • For unit-length embeddings, dot product and cosine similarity are equal. That is why many vector databases use dot product for speed.
  • Many embedding models rarely produce cosine scores near 0 even for unrelated text, so calibrate thresholds on your own data instead of trusting the labels.
  • Euclidean distance grows with magnitude. Normalize first if vector lengths vary for reasons that have nothing to do with meaning.
  • Only outer brackets are stripped, so nested lists like [[1,2],[3,4]] will be rejected. Paste one flat vector per box.

06Related concepts

Cosine similarity, Embeddings, Euclidean distance, Dot product, Vector search.

Frequently Asked Questions

What is Vector Similarity Calculator?

Vector Similarity Calculator is a free, browser-based developer tool on AIDToolStack. Calculate cosine/euclidean similarity between vectors It requires no installation or sign-up and works entirely in your browser.

Is Vector Similarity Calculator free to use?

Yes. No sign-up, no fees and no usage cap.

Does Vector Similarity Calculator store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe