Loading ModelMetric Lab
Embeddings

Cosine similarity calculator

Paste two vectors to calculate their cosine similarity, dot product, and Euclidean norms. The breakdown makes it clear whether a score changed because of direction or magnitude.

Free · no sign-in · updates instantly

1. Enter two equal-length vectors

Numbers separated by commas, spaces, or lines
Must have the same number of dimensions
Try an example:

Results update as you type.

Cosine similarity0

Directional alignment

Dot product0

Σ(Aᵢ × Bᵢ)

Norm A0

Length of vector A

Norm B0

Length of vector B

Formula

cosine similarity = dot(A, B) ÷ (||A|| × ||B||)

Cosine similarity is undefined for a zero vector. For embeddings, use the same model and preprocessing on both sides, then calibrate any threshold on your own labeled examples.

Read the full explanation

See cosine similarity explained with examples for the worked arithmetic, embedding-search guidance, and common mistakes.