Skip to content

Cosine Similarity Calculator

Compare two embedding vectors by cosine similarity, dot product and distance.

Paste JSON arrays, comma-separated or space-separated numbers — straight from an embeddings API response or a vector database row. Both vectors need the same number of dimensions.

Quick Tool Overview

The Cosine Similarity Calculator compares two vectors or embeddings and returns cosine similarity and distance, the angle between them, the dot product, Euclidean and Manhattan distance and each vector length, with notes on which metric vector databases use.

What it does
Measures similarity between two vectors
You give it
Two embedding vectors of the same length
You get back
Cosine similarity, dot product and distances
Best for
Debugging semantic search and embeddings
AI Tools Free, unlimited use No sign-up Runs in your browser

About the Cosine Similarity Calculator

Semantic search, recommendation and deduplication all come down to comparing vectors: embed two pieces of text, measure how closely the vectors point in the same direction, and treat that as how closely the meanings match. Cosine similarity is the measure almost everyone uses.

Paste two vectors as JSON arrays, comma-separated or space-separated numbers — straight from an embeddings API response or a vector database row — and get cosine similarity and cosine distance, the angle between the vectors, the dot product, Euclidean and Manhattan distances, the normalised Euclidean distance and the length of each vector, with a scale from opposite to identical.

When both vectors are normalised, the page points out that dot product and cosine similarity are the same number, which is why vector databases can use the cheaper operation. A reference card shows which operator pgvector, Pinecone, Qdrant, FAISS and Chroma use for each metric.

Key features of the Cosine Similarity Calculator

Every common metric

Cosine similarity and distance, angle, dot product, L2, normalised L2 and L1.

Paste any vector format

JSON arrays, comma-separated or space-separated numbers from an API or database.

Dimension check

Vectors of different lengths are rejected with a clear explanation.

Normalisation detection

Notes when both vectors are unit length, so dot product equals cosine.

Vector database reference

pgvector, Pinecone, Qdrant, FAISS and Chroma metric names side by side.

How to use the Cosine Similarity Calculator

  1. 1

    Paste vector A

    A JSON array or a list of numbers separated by commas or spaces.

  2. 2

    Paste vector B

    It must have the same number of dimensions and come from the same model.

  3. 3

    Read the similarity

    Cosine similarity runs from -1 for opposite, through 0 for unrelated, to 1 for identical direction.

  4. 4

    Compare other measures

    Dot product and distances are listed for the metric your database uses.

Frequently asked questions

The cosine of the angle between two vectors: their dot product divided by the product of their lengths. It measures direction and ignores magnitude, which suits text embeddings.

Reviews of the Cosine Similarity Calculator

What people who use the Cosine Similarity Calculator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Cosine Similarity Calculator. It takes half a minute and no account.

Write the first review

More AI tools