Vector Distance Suite

Compare embedding vectors with cosine, dot, Euclidean, and Manhattan distance.

Ad placeholder (leaderboard)

Vector distance suite

Different vector databases and embedding models expect different distance functions, and the choice subtly changes which results rank highest. This tool computes the four metrics you actually care about — cosine similarity, dot product, Euclidean (L2) distance, and Manhattan (L1) distance — for the same pair of vectors, so you can compare them at a glance and match your retrieval configuration without writing a script.

How it works

The tool parses both inputs into equal-length number arrays and computes each metric directly:

  • Cosine similarity — dot product divided by the product of L2 norms; range −1 to 1.
  • Dot product — sum of element-wise products; unbounded, magnitude-sensitive.
  • Euclidean (L2) distance — square root of the sum of squared differences.
  • Manhattan (L1) distance — sum of absolute differences.

It also reports cosine distance (1 − cosine) since many databases express similarity that way. All four update instantly as you edit either vector.

Tips and notes

  • Normalise to compare fairly. On unit-length vectors, cosine and dot product agree and Euclidean ranking matches cosine — useful for verifying your embeddings are normalised.
  • Match your store’s metric. Pinecone, Weaviate, pgvector, and FAISS each default to specific metrics; pick the one your index uses to predict its ranking.
  • Watch magnitude with dot product. If one vector is much longer, dot product can rank it high even when its direction is a poor match.
  • Local only. Nothing leaves your browser.
Ad placeholder (rectangle)