Cosine Similarity Calculator

Calculate the cosine similarity between two numeric vectors (e.g. embeddings).

Separate numbers with commas, spaces, or new lines. Both vectors must be the same length.

What is Cosine Similarity?

Cosine similarity measures how similar two vectors are by the angle between them, ranging from -1 (exactly opposite) to 1 (pointing in exactly the same direction), with 0 meaning unrelated (perpendicular). It's the standard way to compare embedding vectors — the numeric representations of text, images or other data produced by AI models — since it ignores vector length and focuses purely on direction, which is what typically encodes meaning in an embedding space.

How to use it

  1. Paste two numeric vectors of the same length (for example, two embedding vectors from an embeddings API).
  2. Click Calculate to get the cosine similarity score.

This tool compares two vectors of numbers you already have — it does not generate embeddings from raw text itself, since doing that would require running a separate embedding model. If you have two pieces of text and want their semantic similarity, generate embeddings for each with your embedding provider of choice first, then paste the resulting vectors here. All math runs locally in your browser.