Home / Glossary / AI and machine learning

AI and machine learning

Cosine similarity

Also searched as: semantic similarity score

In shortCosine similarity is a number that measures how closely two vectors point in the same direction. When text is turned into embeddings, cosine similarity is a common way to score how close two pieces of text are in meaning. A higher score suggests a closer match, but it is a rough guide, not a ranking factor you can read from Google.

By Aditya Aman, working in SEO for almost a decade and hands-on with AEO and GEO as those fields have developed. Updated 25 November 2026.

  • What it measuresThe angle between two vectors, not their length.
  • Typical rangeOften -1 to 1, with higher meaning more similar.
  • Used forMatching queries to passages, finding duplicates, clustering.
  • NeedsEmbeddings made by the same model.
  • Common mistakeTreating a score as a universal pass mark.

What is cosine similarity?

Cosine similarity compares two lists of numbers, called vectors, by the angle between them. If they point the same way, the score is high. If they point in unrelated directions, it is near zero. Length does not matter, only direction.

In search and content work, the vectors are usually embeddings, which represent the meaning of a query, a page or a passage. The score then acts as a similarity measure between two pieces of text.

How is it used in SEO and AI search work?

Retrieval systems often embed a question and a set of passages, then pick the passages with the closest scores. SEO teams use the same idea for their own tasks: grouping keywords by meaning, spotting pages that overlap, and checking whether a page is close to the topic of a query.

These are working tools, not a view into Google. Search engines do not publish how they score pages, and a score from your own tool says nothing certain about rankings.

TaskHow the score helpsCaution
Keyword clusteringGroups queries with close meaningCheck clusters by eye
Cannibalization checksFlags pages that cover the same topicClose score is a hint, not proof
Internal link suggestionsFinds related pages to linkReview for real usefulness
Passage matchingFinds the best passage for a questionDepends on the embedding model

How do you use and read the scores?

Scores only compare vectors from the same embedding model. A 0.80 from one model is not the same as 0.80 from another. Set your own thresholds by looking at examples you know are close and examples that are not.

  1. Pick one embedding modelUse the same model for everything you compare.
  2. Embed your textsCreate vectors for queries, titles or page sections.
  3. Score known pairsTest pairs you already judge as related or unrelated.
  4. Set a working thresholdChoose a cutoff from those examples, then review the borderline cases by hand.

What are common mistakes with cosine similarity?

The biggest mistake is chasing a score. Rewriting a page to push its similarity to a query higher does not guarantee better rankings or citations. Another is comparing scores across different models or across very different text lengths.

A high score can also hide a mismatch in intent. Two texts can be about the same subject while one is a guide and the other is a sales page. Always read the pages.

Need help with Cosine similarity on your site?

Tell us what is not working. We will check where this affects your search results and what to fix first.

Book a meetingAEO services

Questions people ask

Is cosine similarity a Google ranking factor?

Google has not published it as a ranking factor, and you cannot read Google's scores. It is a general method used in many systems. Use it as a working tool in your own analysis, not as a target.

What is a good cosine similarity score?

There is no universal answer. Scores depend on the embedding model and the text. Test pairs you know are related and unrelated, then choose a threshold that separates them for your own data.

Why use cosine similarity instead of keyword overlap?

Embedding-based scores can match texts with similar meaning but different words. Keyword overlap misses that. Overlap is still useful for exact terms, which is why many systems combine both.

Inspect the original evidence