A worked example, rendered from real sample data. Sign in to run the tool on your own input.
0.1,0.5,0.3,0.8,0.2,0.9,0.4,0.7
---
0.2,0.4,0.35,0.75,0.25,0.85,0.45,0.65═══ Summary ═══
Vectors: 2
Dimensions: 8
Primary metric: cosine
Magnitudes: Vector 1 1.5780 | Vector 2 1.5149
═══ Vector 1 vs Vector 2 ═══
Cosine similarity: 0.993511
Cosine distance: 0.006489
Euclidean distance: 0.187083
Manhattan distance: 0.500000
Dot product: 2.375000
Angle: 6.53°
✓ Near-identical direction
═══ Nearest neighbours by cosine ═══
Vector 1: Vector 2 0.993511
Vector 2: Vector 1 0.993511
═══ Choosing a metric ═══
ℹ Cosine similarity compares direction only and ignores length. It is the usual choice for embeddings, and for L2-normalised vectors it ranks identically to dot product and Euclidean distance.
ℹ Scores are only comparable inside one embedding model. A cosine of 0.82 may mean 'unrelated' for one model and 'near duplicate' for another, so calibrate a threshold on your own data instead of copying one.
ℹ Everything is computed from the numbers you pasted; no model is called and no text is embedded here.
Calculate cosine similarity between two text embedding vectors. Part of the DevTools Surf developer suite. Browse more tools in the AI / Modern Dev collection.