SEO

N-gram

Also called unigram, bigram, trigram

A run of consecutive words treated as one unit, used to find patterns across large sets of queries.

Quick facts: N-gram

Category
SEO
Also called
unigram, bigram, trigram
Level
Advanced
Affects
Query analysis, negative keywords, content planning
Where to see it
Spreadsheets and pivot tables, Search Console query export, Google Ads search terms report
In this article4
  1. What an n-gram is
  2. Why n-grams matter
  3. Common mistakes with n-grams
  4. How to act on it

What an n-gram is

An n-gram is a run of consecutive words treated as a single unit. One word is a unigram, two words a bigram, three a trigram, and beyond that people simply name the length. So SEO is a unigram, SEO services is a bigram, and SEO services in Kathmandu is a four-word n-gram.

The idea matters because meaning lives in sequences rather than in isolated words. Split a query into single words and you lose the difference between shoes for running and running a shoe shop. Keep the pairs and triples and the distinction survives. The same slicing is applied to page text, ad copy, product titles and customer reviews.

Why n-grams matter

The value shows up when you have far more query data than anyone can read. A search terms export from Google Ads, or a query export from Search Console, runs to thousands of rows in which almost every row is unique. Read it line by line and you learn nothing. Break each row into bigrams and trigrams, count them, and the patterns surface: the phrases that take money and never convert, the phrases that convert quietly, the questions people ask around your product.

In a small market the technique earns its keep for a slightly different reason. Nepali accounts often carry too little volume for any single query to be judged on its own record. Grouping by n-gram pools that thin data into buckets big enough to support a decision.

Common mistakes with n-grams

Cutting at the wrong length is the usual one. Pairs are often too coarse to separate intent — price list tells you less than SEO price list — while long n-grams fragment back into near-unique rows and defeat the purpose. Run short and long, then look for the length at which the story changes.

The second mistake is confusing frequent with important. The most common n-grams in any set are nearly always the ones built around stop words or your own brand name. Sort by cost, clicks or conversions instead of by count and the list turns into a decision rather than trivia.

The third is treating an n-gram as a keyword to bid on or a heading to write. It is a unit of analysis. What you do about the finding is a separate judgement.

How to act on it

Start with the search terms report. Export a period long enough to be meaningful, split every term into pairs and triples in a spreadsheet, then total spend and conversions against each phrase with a pivot table. Phrases that have absorbed real spend without a single conversion are candidates for a negative keyword; phrases that convert repeatedly have earned their own ad group, or their own page.

Run the same exercise on Search Console queries for the organic side. Recurring question phrases — how to, cost of, near me — tell you which format the page is missing: a set of steps, an explanation of pricing, a clearer location signal. That is far more useful than another ranked list of individual keywords, and it feeds straight into keyword research.

Do and do not

Do

  • Group thin query data into countable phrase patterns
  • Sort by cost or conversions, never by count
  • Test both short and longer phrase lengths

Do not

  • Bid on a phrase without reading the full query
  • Assume the most frequent phrase is the important one
  • Ignore stop words where they change the meaning

Questions people ask about this

How is an n-gram different from a keyword?

A keyword is something you choose to target, with intent and commercial value attached to it. An n-gram is a mechanical slice of text: every run of consecutive words in whatever you are analysing. Most n-grams mean nothing on their own. Their value is in collapsing thousands of unique queries into a few countable patterns.

Do I need programming skills to use n-grams?

No. A spreadsheet handles it well enough for most accounts: split the query column into words, rebuild pairs and triples with a formula, then use a pivot table to total clicks, cost and conversions against each phrase. Scripting only earns its place when you repeat the exercise across many accounts or very large exports.

What phrase length should I analyse?

Try more than one. Pairs group data broadly and suit small accounts where volume is thin, while triples separate intent more sharply and suit accounts with plenty of search terms. The right length is the one where a pattern becomes obvious and still has enough rows behind it to be worth trusting.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.