Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

cosine similarity

A similarity score between two vectors based only on the angle between them, ignoring their length.

Cosine similarity between vectors u and v is \frac{u \cdot v}{\lVert u \rVert \lVert v \rVert}, the cosine of the angle between them: 1 for identical direction, 0 for perpendicular, -1 for opposite. Because it ignores vector length, it is the standard similarity measure for text embeddings, where length often reflects passage length rather than meaning.

Examples

  • Two embeddings pointing in nearly the same direction score close to 1.0; two at right angles score close to 0, regardless of how long either vector is.

Read the full section →
Graph settings

Calculator