Don's Tools · Developers · Embedding & Vector Calculator

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.

-Cosine similarity (-1 to 1)
-Dot product
-Angle between (degrees)
-Euclidean distance
-Manhattan distance
-Magnitude |A| , |B|
-Dimensions
Embedding & Vector Calculator compares two vectors or embeddings and reports cosine similarity, dot product, the angle between them, Euclidean and Manhattan distance and the magnitude of each. Paste numbers separated by commas, spaces or new lines, or a JSON array copied straight from your code, and the results update live. It handles large embeddings such as 1536 dimensional vectors, and everything is calculated locally with nothing uploaded.

Files are processed in your browser and never uploaded.

How to use Embedding & vector calculator

  1. 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.

  2. Read the result

    The output updates as you type, so there is nothing to submit and nothing to wait for.

  3. 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: