Technical SEO
Keyword Clustering by SERP Overlap: The Method That Maps to How Google Actually Ranks
Keyword clustering is grouping search terms that share the same intent so one page can target the whole group. The reliable way to decide which keywords belong together is SERP overlap: two keywords go in the same cluster when Google already returns the same URLs for both.
This guide covers the method step by step, a worked example on seven real keywords with live Google results, a short Python script that does the overlap maths, how many shared results should count as one cluster, and how to turn finished clusters into a content plan. If you want to compare the software that does this at scale, see this comparison of the best keyword clustering tools.
Key takeaways
- Keyword clustering groups keywords by shared search intent so one page can rank for many terms. The efficiency case is large: in Ahrefs’ 2017 study of 3 million searches, “the average #1 ranking page will also rank in the top10 for nearly 1,000 other relevant keywords.”
- Cluster by SERP overlap, not string similarity. In the worked example below, “king size mattress” and “king size mattress dimensions” share three words and zero ranking URLs.
- The threshold is a dial. Three shared URLs is the common starting point (Keyword Insights’ documented default), but SERP features now leave only 5 to 8 classic organic URLs in the top 10, so the same number is stricter than it used to be.
- Hard and soft clustering give different answers on the same data. Use hard clustering for money pages and confirm borderline groups with page metrics.
- Clustering feeds AI search too. In AI SEO the secondary terms in a cluster are the “fan-out queries” an assistant expands your prompt into.
What is keyword clustering?
Semrush defines keyword clustering as “an SEO technique centered on grouping search terms that share the same search intent (what the user is trying to achieve) and targeting them together on a single page.” Ahrefs frames the mechanics more precisely: clustering “is typically done by grouping keywords with the same or similar search results,” because “if Google ranks the same pages for many keywords, they have the same or similar intent and should generally be targeted on the same page.”
That second definition is the one that matters, and it runs through this guide. You can decide whether two keywords belong together by comparing the words (“king size mattress” and “king mattress” look alike) or by comparing the search results Google already returns for each. The first is fast and wrong often enough to cost you rankings. The second, clustering by SERP overlap, is slower, defensible, and mirrors the only opinion that decides your rankings: Google’s.
Why cluster at all? One page ranks for far more than one keyword
The instinct to build one page per keyword comes from a misreading of how ranking works. A page does not rank for a single term; it ranks for a topic, and topics span hundreds of queries.
Ahrefs’ study of 3 million searches, published in 2017, put a number on it: “the average #1 ranking page will also rank in the top10 for nearly 1,000 other relevant keywords (while the median value is more than two times smaller - around 400 keywords).” The team “picked 3 million random search queries and looked at the top-ranking pages and how many other keywords they rank for,” so the figure describes ordinary pages, not outliers.

Semrush shows the same effect from the other direction with a live example: a single page that “ranks for about 2,200 keywords and attracts an estimated 183,100 organic visits per month from the U.S.” That traffic came from one page satisfying one intent, not from 2,200 separate pages.
The practical consequence is a change in your unit of work. Stop asking “what page do I build for this keyword?” and start asking “which keywords does Google already treat as the same page, and have I built that page yet?”
SERP overlap vs string similarity
The easy way to group keywords is by the words themselves, a process called lemmatisation, where terms are reduced to their base forms and grouped by shared roots. Wikipedia describes lemma-based keyword grouping as a process where keywords “are broken down into lemmas” and “keywords with matching lemmas are grouped together.” Semantic clustering (grouping by embedding similarity) is a more sophisticated version of the same idea, but it still decides relatedness from the keywords, not from the results.
Google does not rank words; it ranks pages against intent, and intent does not always follow vocabulary. Two keywords can look nothing alike and return almost identical URLs, and two keywords that share most of their words can return completely different results.
SERP-based clustering asks the source that decides your rankings. As Wikipedia puts it: “Compared to lemma-based keyword grouping, SERP-based keyword clustering produces groups of keywords that might reveal no morphological matches, but will have matches in the search results. It allows search engine professionals getting a keyword structure close to what a search engine dictates.”
You can sanity-check any single pair without a tool. Ahrefs shows “a SERP similarity score out of 100 (high = cluster, low = don’t, middle = take your best guess)” when you compare two keywords in Keywords Explorer. Underneath, the idea is a count of shared results, and the next sections turn that count into a repeatable process.
How to cluster keywords by SERP overlap, step by step
1. Build a keyword list. Start with a few broad seed terms and expand them with a keyword tool until you have the realistic variations: questions, modifiers, long-tail phrasings and near-synonyms. Over-collecting is fine because the SERPs do the filtering. Pull competitor rankings too, since a rival’s keyword list surfaces terms your seed expansion missed.
2. Pull the organic results for each keyword. Record the URLs Google returns on page one. Ahrefs notes that dedicated tools such as Keyword Insights “group keywords by comparing the top 10 or 100 search results for your keywords.” Strip out AI Overview citations, sitelinks, shopping units and People Also Ask boxes: compare classic organic URLs only.
3. Count shared URLs for every pair. Two keywords are candidates for the same cluster when the same URLs appear in both result sets. Compare full URLs, not domains. Keyword Insights makes the same point about its own tool: “we look at the full ranking URL when clustering and not the root domain.”
4. Set the clustering level (your overlap threshold). Wikipedia defines it as “a minimum number of matches in the search results that trigger keyword clustering.” A higher level “produces more groups with fewer keywords in every group,” while “the clustering level 1 or 2 will create a few groups with a lot of keywords in each of them.” The section on thresholds below covers what number to pick.
5. Choose how strict the grouping is across the whole cluster. Wikipedia documents three modes. Under soft clustering, keywords are compared with the highest-volume keyword, so they “will not necessarily be related to each other.” Under hard clustering, “all keywords within a group will be related to each other by having the same matching URLs.” Moderate sits between the two. Keyword Insights ships the same two ideas as its Centroids and Agglomerative algorithms, and recommends Agglomerative (the all-pairs method) “for most customers, in most niches.”
The same SERP-reading habit underpins a good technical SEO audit, where you are already checking what Google returns and how it treats your pages. Clustering applies that habit to keyword strategy.
A worked example: seven mattress keywords on live SERPs
To show the method on real numbers rather than a diagram, I took seven keywords around one product and pulled the US organic results for each from Ahrefs’ SERP overview (Google snapshots dated 16 to 23 September 2026), with search volumes from Ahrefs Keywords Explorer. “King size mattress” and “king mattress” are the pair Semrush uses to illustrate a cluster, so the example also tests that claim. The data file is published here so you can rerun it.
| Keyword | US volume | Organic URLs in top 10 |
|---|---|---|
| king size mattress | 84,000 | 5 |
| king size bed dimensions | 62,000 | 8 |
| king mattress | 48,000 | 6 |
| california king vs king | 29,000 | 7 |
| king size mattress dimensions | 16,000 | 8 |
| how big is a king size bed | 11,000 | 7 |
| best king size mattress | 7,100 | 6 |
The third column is the first finding. No keyword had ten classic organic results in its top ten positions: AI Overviews, shopping units, image packs, local packs and People Also Ask boxes took the rest. “King size mattress” had only five.
Pairwise overlap
Every pair was compared on full URLs. Only six of the 21 pairs shared anything at all:
| Pair | Shared URLs |
|---|---|
| king size mattress / king mattress | 4 |
| king size bed dimensions / king size mattress dimensions | 3 |
| king size bed dimensions / how big is a king size bed | 3 |
| king mattress / best king size mattress | 2 |
| king size mattress dimensions / how big is a king size bed | 2 |
| king size mattress / best king size mattress | 1 |
Three things stand out:
- Semrush’s example holds. “King size mattress” and “king mattress” share four of their five or six organic URLs, all retailer category pages (Mattress Firm, Mattress Warehouse, Serta and Costco). One transactional page covers both.
- Shared words mean nothing on their own. “King size mattress” and “king size mattress dimensions” differ by one word and share zero URLs. One SERP is shops, the other is size guides. A lemma or string-based grouper would merge them; Google does not.
- Different phrasing can still be one intent. “How big is a king size bed” shares three URLs with “king size bed dimensions” (Avocado’s size guide, Biltrite and dimensions.com) despite having a different structure.
“California king vs king” shares nothing with any other keyword. It is a comparison intent and needs its own page, even though every word in it appears elsewhere in the set.
What the threshold and the mode change
Running the same data through the script in the next section gives these clusters:
| Setting | Clusters |
|---|---|
| Hard, threshold 2 | king size mattress + king mattress · king size bed dimensions + king size mattress dimensions + how big is a king size bed · california king vs king · best king size mattress |
| Hard, threshold 3 | king size mattress + king mattress · king size bed dimensions + king size mattress dimensions · how big is a king size bed (alone) · california king vs king · best king size mattress |
| Soft, threshold 3 | Same as hard threshold 2 |
| Hard, threshold 4 | king size mattress + king mattress · every other keyword alone |
The borderline keyword is “how big is a king size bed”. It shares three URLs with the seed of its cluster (“king size bed dimensions”, the higher-volume term) but only two with “king size mattress dimensions”. Soft clustering checks against the seed only, so it joins. Hard clustering checks every member, so at threshold 3 it is left on its own.
In practice this is one page: a king size dimensions guide targeting “king size bed dimensions”, with “king size mattress dimensions” and “how big is a king size bed” as secondary keywords. That is the judgement the numbers are there to support: the threshold proposes, a person with the SERPs open decides.
“Best king size mattress” never joins the shopping cluster. It shares two URLs with “king mattress” and one with “king size mattress”. Its SERP is review roundups (Mattress Nerd, Mattress Clarity, Sleep Foundation, Forbes) plus Reddit, which is commercial investigation, not a category page. It needs its own page.
Calculating SERP overlap in Python
The whole method fits in a short standard-library script. It reads a JSON file of keywords, volumes and organic URLs (the same shape as the example data), counts shared URLs for every pair, then clusters the list in descending volume order so the biggest keyword seeds each cluster.
import json
import sys
from itertools import combinations
def shared_urls(serps, depth=10):
"""Count the URLs each pair of keywords has in common in its top organic results."""
top = {kw: set(row["urls"][:depth]) for kw, row in serps.items()}
pairs = {}
for a, b in combinations(top, 2):
pairs[a, b] = pairs[b, a] = len(top[a] & top[b])
return pairs
def cluster(serps, threshold=3, mode="hard"):
"""Group keywords by SERP overlap, biggest keyword first.
hard: join a cluster only if the keyword shares >= threshold URLs with every member.
soft: join a cluster if the keyword shares >= threshold URLs with the cluster's seed.
"""
pairs = shared_urls(serps)
clusters = []
for kw in sorted(serps, key=lambda k: -serps[k]["volume"]):
for members in clusters:
check = members if mode == "hard" else members[:1]
if all(pairs[kw, m] >= threshold for m in check):
members.append(kw)
break
else:
clusters.append([kw])
return clusters
if __name__ == "__main__":
# {"keyword": {"volume": 84000, "urls": ["https://...", ...]}, ...}
serps = json.load(open(sys.argv[1]))
threshold = int(sys.argv[2]) if len(sys.argv) > 2 else 3
mode = sys.argv[3] if len(sys.argv) > 3 else "hard"
for (a, b), n in sorted(shared_urls(serps).items(), key=lambda p: -p[1]):
if n and a < b:
print(f"{n} shared {a} | {b}")
print(f"\n{mode} clustering, threshold {threshold}:")
for members in cluster(serps, threshold, mode):
print(" " + " + ".join(members))
Run it as python3 serp_clusters.py king-mattress-serps.json 3 hard. On the example data it prints the six overlapping pairs and the hard threshold 3 clusters shown above.
A few notes for using it on real lists:
- Getting the URLs. Any SERP API or rank tracker export works. Keep organic results only and store full URLs; normalise trailing slashes and tracking parameters before comparing, or identical pages will not match.
- Scale. Pairwise comparison grows with the square of the list. A few thousand keywords is fine on a laptop; beyond that, block by a shared term or parent topic first and compare within blocks.
- Order dependence. Greedy clustering depends on the order keywords are processed. Seeding by volume is the convention Wikipedia describes for soft clustering, and it keeps the head term as each cluster’s name.
Fetching SERPs and computing overlap is exactly the kind of step that belongs in an SEO automation pipeline rather than a spreadsheet.
How many shared results count as one cluster?
There is no official number, because clustering is a practitioners’ convention rather than anything Google documents. The defaults in the tools are the best reference:
- Keyword Insights’ grouping accuracy page says “By default, we use the value 3. It means if we see 3 common URLs for keywords, these keywords will be put into a single cluster.”
- Its clustering types page describes both algorithms as grouping keywords that share a number of URLs “from the top 7 (x can be changed by you, but it is set at 4 by default).” Both pages were read on 24 September 2026, and the two defaults differ, so check the setting in the tool itself.
- SE Ranking’s Keyword Grouper lets you “define the minimum number of matching URLs and clustering method,” and notes that “the higher the accuracy the less search queries will be added to one group.”
Keyword Insights explains the move to seven results directly: SERP features “are pushing traditional organic listings further down the page,” so “the top 7 organic results now provide a more accurate representation of what users actually see.” The worked example agrees. With five to eight organic URLs per top 10, three shared URLs is a much larger share of each SERP than it was when ten organic results were the norm.
A practical rule set:
- Start at 3 shared URLs out of the organic results in the top 10 (or 3 to 4 out of the top 7).
- Use hard clustering for pages you are building now, especially commercial and transactional ones, where merging two intents costs rankings.
- Use soft clustering or a threshold of 2 for exploration and topic mapping, then prune.
- Review every keyword that sits exactly on the threshold by opening both SERPs, as with “how big is a king size bed” above.
- Raise the threshold if clusters mix intents; lower it if you get dozens of single-keyword clusters that obviously belong together.
Classifying search intent inside a cluster
SERP overlap tells you which keywords Google treats alike; intent tells you what to do with the resulting page. Semrush works from four main types of search intent:
- Informational: the searcher wants to learn something (“king size bed dimensions”).
- Navigational: the searcher wants a specific page or brand.
- Commercial: the searcher is researching options before buying (“best king size mattress”).
- Transactional: the searcher is ready to act (“king size mattress”).
Most of the time, keywords that share a SERP also share an intent, which is why they share a SERP. The edges matter. When a cluster straddles two intents, split it. A page that tries to teach a method and sell a product in the same breath satisfies neither searcher, and Google will rank a more focused competitor above it.
When SERP overlap misleads: confirm with page metrics
Overlap is strong evidence, not proof. Google sometimes returns a mixed SERP, and a naive tool will merge keywords that should stay apart. Ahrefs gives a clean example. Pages ranking for “chocolate cake recipe” averaged a Domain Rating of 74 with 318 linking domains; pages about “chocolate cake recipe with coffee” averaged DR 33 with 11. Both tools Ahrefs tried grouped the two keywords, yet, as Ahrefs concludes, “Clustering, as the tools suggested, would probably be a mistake.”

So add a confirmation step for every borderline cluster: before you merge, look at the Domain Rating and referring domains of the pages actually ranking. If the authority profiles differ sharply, the easier keyword is a distinct opportunity that deserves its own page. Overlap gets you to a shortlist; page-level metrics decide the close calls.
From clusters to a content plan
Finished clusters are a content plan in disguise. Each cluster becomes one page: its highest-volume, best-fit term is the primary keyword and the rest are secondary keywords. Semrush offers three questions to pressure-test a grouping: SERP similarity (“Do the same pages rank well for those keywords?”), content quality (would separate pages each be too thin?), and user journey (would one reader want all of this at once?). If a cluster passes all three, it is a page, and the cluster itself becomes the keyword section of the content brief for that page.
Then prioritise. Rank clusters by combined search volume against how winnable they are: a tight cluster of low-difficulty terms beats a high-volume cluster dominated by DR 90 publishers. Clusters that reinforce one another build topical authority, which earns a domain the right to rank for harder head terms over time.
When a set of clusters shares a repeatable template (locations, comparisons, use cases), that is where clustering feeds programmatic SEO. For SaaS teams, the cluster-to-page discipline is the backbone of SEO for SaaS: every feature and use case earns its own intent-matched page instead of one bloated features URL.
Where AI and automation fit (and the AI-search payoff)
Doing SERP-overlap clustering by hand caps out fast. Pulling and comparing results for hundreds of keywords is the first stage I hand to a machine in SEO content automation.
A useful model is embeddings plus SERP validation: let a model propose candidate groups from meaning, then confirm each against real search results before you trust it. My free keyword clustering tool covers the first half. It clusters up to 1,000 keywords by semantic similarity, which is quick for a first pass over a raw export, and the script above is the check against Google.
The payoff now extends past classic rankings. Semrush notes that “clustering like terms on the same page works well for improving your visibility in AI systems like ChatGPT as well. In AI SEO, the secondary terms in a cluster are called fan-out queries.” When an assistant answers a question it expands the prompt into related sub-queries (see how ChatGPT query fan-out works), so a page built around a complete cluster is already shaped for how AI search retrieves and cites content.
Frequently asked questions
What is keyword clustering in SEO?
Keyword clustering is grouping search terms that share the same intent so they can be targeted with a single page rather than many. The most reliable way to group them is by SERP overlap: keywords go in the same cluster when Google returns the same pages for them, which shows Google treats them as one intent.
How many shared results count as one cluster?
Three shared URLs in the top 10 organic results is the usual starting point, and it is the default Keyword Insights documents for its grouping accuracy setting. Because AI Overviews and other SERP features now leave only five to eight organic URLs in many top 10s, three is stricter than it sounds. Use hard clustering at 3 for pages you are building, drop to 2 for exploration, and check any keyword that sits exactly on the line by opening both SERPs.
What is the difference between keyword clustering and keyword grouping?
Keyword grouping usually means organising keywords by shared words or themes, a lemma or term-based approach. Keyword clustering, in its stronger form, means grouping by shared search results. The distinction matters because keywords with different wording can share a SERP, while keywords with nearly identical wording, such as “king size mattress” and “king size mattress dimensions”, can share none.
How do you cluster keywords by SERP overlap?
Build a broad keyword list, pull the organic results for each keyword, and count the URLs every pair has in common. Group keywords that meet your threshold, starting with the highest-volume keyword, and choose soft clustering (compare with the seed keyword) or hard clustering (compare with every member). A short Python script like the one in this guide does the counting once you have the URLs.
Is SERP-based clustering better than semantic clustering?
For deciding page architecture, yes, because it reflects how Google actually ranks rather than how similar the words are. Semantic clustering is useful for discovery and for proposing candidate groups quickly from a large export. Validate those candidates against live search results before you build pages around them.
How does keyword clustering help with AI search visibility?
AI assistants answer a query by fanning it out into related sub-queries and drawing from pages that cover the whole set. The secondary terms in a keyword cluster are effectively those fan-out queries, so a page built around a complete SERP-overlap cluster already matches how assistants retrieve and cite content. The same clustering work pays off in both classic and AI search.