Cosine Similarity Calculator

Compare vectors or embeddings: cosine similarity, angle, dot product and distance.

Similarity

Examples

Questions

What does cosine similarity measure?

The angle between two vectors, ignoring their length. 1 means they point the same way, 0 means they are unrelated (at right angles), and -1 means opposite.

Why is it used for embeddings?

An embedding model turns text into a vector, and similar meanings point in similar directions. Cosine similarity compares direction only, so a long text and a short one on the same topic still score high.

What input formats work?

One vector per line, with numbers separated by commas or spaces. Brackets from JSON are fine, and so is a label before a colon, like "cat: 0.1, 0.2". A whole JSON array of arrays on one line also works.

Cosine similarity or Euclidean distance?

For normalised embeddings (length 1), they rank results the same way. For other vectors, Euclidean distance also counts length, so use cosine when only direction should matter.

Can it make embeddings from text?

No. There is no model on this page. Paste vectors you already have, from any embedding model.