Embedding & vector calculator
Paste two embeddings or vectors to get cosine similarity, dot product, Euclidean and Manhattan distance, the angle between them and each magnitude, all in your browser.
Files are processed in your browser and never uploaded.
How to use Embedding & vector calculator
Add your text
Type or paste your text into the input box. Everything is handled by your own browser, so nothing is sent to a server.
Read the result
The output updates as you type, so there is nothing to submit and nothing to wait for.
Copy or save it
Copy results puts the result on your clipboard.
What this tool does
Cosine similarity, dot product and angle
Cosine similarity is the measure embeddings are usually compared with, and the dot product and the angle between the vectors are given alongside it.
Euclidean and Manhattan distance
Euclidean and Manhattan distance are both there, for the cases where absolute distance matters more than direction.
Magnitude of each vector
The magnitude of each vector is shown, which is how you spot an unnormalised embedding before it skews a comparison.
Accepts commas, spaces, new lines or JSON arrays
Paste vectors separated by commas, spaces or new lines, or as JSON arrays, so whatever you copied out of a notebook works.
Handles large embeddings, nothing uploaded
Embeddings with thousands of dimensions are handled, and everything is calculated in your browser with nothing uploaded.
Frequently asked questions
Is anything uploaded or saved?
No. Both vectors are parsed and all the maths runs in your browser. Nothing you paste is sent anywhere or stored.
What formats can I paste?
Numbers separated by commas, spaces or new lines, or a JSON array like [0.1, -0.2, 0.3]. Surrounding square brackets are handled automatically, so you can paste an embedding straight from your code.
Which measures does it calculate?
Cosine similarity, the angle between the vectors, dot product, Euclidean and Manhattan distance, and the magnitude of each vector. Cosine similarity is the usual choice for comparing embeddings.
Why do I get a length error?
Cosine similarity, distance and dot product only make sense when both vectors have the same number of dimensions. Magnitudes are still shown for each, but the pair measures need equal length.
Can it handle large embeddings?
Yes. It comfortably handles long vectors such as 768, 1024 or 1536 dimensional embeddings, since it is plain arithmetic done locally.
Last updated: