Cosine Similarity Calculator
Angle-based similarity between two vectors — the core of semantic search, embeddings and recommendation.
Cosine ranges −1 (opposite) to +1 (identical direction); for non-negative embeddings it's effectively 0 to 1. It ignores magnitude, which is why it's the default for comparing text embeddings where direction encodes meaning and length encodes nothing useful.
Formula
About Cosine Similarity Calculator
Cosine similarity is the measurement at the heart of every embedding-based system — semantic search, RAG retrieval, recommendation, clustering, deduplication. It measures the angle between two vectors, ignoring their magnitudes, so two documents about the same topic score high regardless of length. This calculator computes the cosine similarity, the corresponding cosine distance (1 − similarity) used by vector databases, and the actual angle in degrees. Paste two embedding vectors to see exactly how 'close' your model thinks two items are.
How to use Cosine Similarity Calculator
- 1Enter your values into Cosine Similarity Calculator — sensible, domain-typical defaults are pre-filled so you see a real result immediately.
- 2The result recomputes live using the formula shown on the page; there is no button to press.
- 3Adjust any input to compare scenarios, then read the worked example to see the substituted numbers.
Why use Cosine Similarity Calculator?
- ✓Computes Cosine Similarity instantly in your browser — no sign-up, no upload, no server round-trip.
- ✓100% free and unlimited, with the exact formula shown: cos(θ) = (A.
- ✓Runs entirely client-side, so every value you enter stays private on your device.
- ✓Live recompute as you type, with a worked example and authoritative references for trust.
Frequently asked questions
Why cosine similarity instead of Euclidean distance for embeddings?+
Because direction encodes meaning while magnitude often encodes irrelevant things like document length or word count. Cosine normalizes away magnitude, comparing only orientation. For normalized embeddings the two are monotonically related anyway, but cosine is the convention and is robust when vectors aren't unit-length.
What's the difference between cosine similarity and cosine distance?+
Distance = 1 − similarity. Similarity is +1 for identical direction (you want HIGH); distance is 0 for identical (you want LOW). Vector databases usually expose distance because nearest-neighbor search minimizes it. They're the same information inverted — just know which your tool reports.
Can cosine similarity be negative?+
Yes, down to −1, when vectors point in opposing directions. With many modern embedding models that output non-negative or roughly centered vectors, you'll often see a practical range of 0 to 1 or 0.3 to 1. Negative values mean genuine semantic opposition, which is rarer and worth investigating.
What similarity threshold means 'a match'?+
There's no universal cutoff — it depends entirely on your embedding model and data. Calibrate it: embed known-similar and known-different pairs, look at the score distributions, and set the threshold where they separate. A value like 0.8 means very different things across models; never copy a threshold between embedding models.
Related ML & AI tools
ROC-AUC Calculator (from TPR/FPR points)
Trapezoidal area under the ROC curve from your (FPR, TPR) operating points — the threshold-independent ranking score.
● LiveClassification Threshold Cost Calculator
Find the probability cutoff that minimizes expected cost given your false-positive and false-negative penalties.
● LiveSilhouette Score Calculator
Cluster cohesion vs separation for one point — the building block of the silhouette metric for choosing K.
● Live