🔒 Processed locally in your browser — no data uploaded
← Back to Home

Embedding Similarity Calculator

Vector A (comma-separated numbers)
Vector B (comma-separated numbers)
Results

What the Embedding Similarity Calculator does

This calculator compares two embedding vectors that you paste in as comma-separated numbers, and returns cosine similarity, Euclidean distance, Manhattan distance, the dot product and each vector's norm. It is a fast way to check a score that a vector database or a retrieval step handed you, without opening a notebook. The arithmetic runs in JavaScript inside the page, so vectors built from private documents never leave the browser tab.

A worked example: both boxes load with a pair of ten-dimension vectors, and pressing Calculate labels them Very Similar, with a cosine value close to 1 and a Euclidean distance under 0.1. Swap the second vector for one taken from an unrelated sentence and the label falls to Weakly Related or Dissimilar once the cosine drops under 0.5, while the two distance figures grow.

How to use it

  1. Paste Vector ACopy the numeric array out of your embedding API response and drop it into the first box. The parser reads values separated by commas, so keep the commas exactly as the API returned them.
  2. Paste Vector BPut the vector you want to compare into the second box. Both sides must hold the same number of values, because the tool refuses to score a mismatched pair and reports the two dimension counts instead.
  3. Press CalculateThe results table fills in straight away. The stats line underneath reports the dimension count, the dot product, and the norm of each vector, which tells you whether both sides came from the same model.
  4. Read the label lastCheck the raw numbers before the Interpretation row. The label is derived from cosine similarity alone, and the two distance values sit beside it with no verdict attached, so you decide what counts as close.

Options and formats

Comma-separated inputValues must be split by commas. Line breaks, tabs and spaces are not treated as separators, so an array pasted with newlines between numbers collapses into one parsed value and skews every result.
Decimal notationWhole numbers, decimals and negative values are all accepted, including scientific notation such as 1.2e-3. Anything the parser cannot read as a number is discarded before the maths runs, without a warning.
Cosine similarityReports a value from -1 to 1 and ignores vector length, which makes it the number to trust when both vectors came from the same model. Only this figure drives the Interpretation label.
Euclidean and ManhattanTwo magnitude-based distances, shown to four decimals. They react to how large the vectors are, not only to their direction, so they suit spot checks on absolute separation rather than ranking subtle similarity.
Interpretation thresholdsFixed cut-offs: above 0.9 Very Similar, above 0.7 Similar, above 0.5 Moderately Similar, above 0 Weakly Related, otherwise Dissimilar or Opposite. Nothing on the page lets you move these boundaries.

Things to watch out for

Mismatched dimensionsVectors of different length are rejected with a message naming both counts. The tool does not pad, trim or align anything, so re-embed the shorter text with the same model before you try again.
Non-numeric tokens vanishBrackets, quote marks or a stray label around a pasted array get filtered out silently. The vector then comes back shorter than the model produced, and every remaining value sits at the wrong position.
Cosine is not a percentageA score of 0.85 does not mean an 85 per cent match. Cosine measures the angle between vectors only, so a short sentence and a long paragraph can score high while saying quite different things.
Scores are model-specificCosine values from two different embedding models are not comparable. Text that lands at 0.9 with one model may land at 0.6 with another, so calibrate cut-offs against pairs you have judged yourself.

Frequently asked questions

Why does my pair return a dimension mismatch error?

The two boxes held different numbers of values. That normally means one vector was cut short while copying, or the two texts were embedded with different models or different truncation settings. Check the value count in each box, then re-embed the shorter text with the model that produced the other vector.

What cosine similarity counts as a good match?

It depends on the model and the corpus, so no single number is universal. With common text embedding models, paraphrases often score above 0.8, loosely related passages sit around 0.5 to 0.7, and unrelated text lands near zero. Use the built-in labels as a rough guide, then test pairs from your own data.

Should I look at cosine similarity or Euclidean distance?

Use cosine when the length of the text should not influence the score, which is the usual case for text embeddings. Use Euclidean distance when absolute position matters, such as comparing image features or checking whether two points sit in the same cluster. This page reports both so you can compare them side by side.

Does the tool normalise the vectors first?

No. Cosine similarity divides by both norms, so it returns the same value whether or not your vectors are already unit length. The Euclidean and Manhattan figures are raw distances, so they do change if you scale or shorten a vector before comparing.

Can I compare one vector against several candidates?

Not in a single run, because the page holds two boxes and scores one pair at a time. Keep the reference vector in the first box and paste each candidate into the second, noting the cosine value before you overwrite it. The Clear button empties both boxes.

Are my vectors sent to a server?

No. Parsing and arithmetic happen in JavaScript in the page, and nothing is posted anywhere. That matters when the text behind an embedding is confidential, because a similarity check on internal documents leaves no trace in a server log or an analytics record.