Back to Glossary
SEO

TF-IDF

TF-IDF is an information-retrieval statistic that weights how important a word is to a document within a collection by multiplying term frequency (TF) by inverse document frequency (IDF). It lowers the weight of words that appear everywhere and raises the weight of words that appear rarely.

  • TF-IDF = term frequency (TF) × inverse document frequency (IDF), a standard information-retrieval metric that quantifies a word's relative importance within a document.
  • TF measures how often a word appears in a single document, while IDF measures how rare that word is across the entire document collection.
  • Karen Spärck Jones introduced IDF in 1972, and the metric is widely used in search engines, text mining, and document classification.
  • The official and industry consensus is that Google does not use TF-IDF as a direct ranking factor, so in SEO it is safer to treat it only as a guiding principle.

Overview

TF-IDF (Term Frequency–Inverse Document Frequency) is an information-retrieval statistic that weights how important a word is within a document, adjusting for how common that word is across the whole collection. A word that appears often in a particular document but rarely in the others receives a higher score. In other words, it is used to surface the key words that characterize a given document.

It is built from two components. TF (term frequency) looks at how often a word occurs within a single document, treating higher frequency as a sign that the word matters more to that document. IDF (inverse document frequency) measures how rare a word is across the entire collection, lowering the weight of common words that appear in nearly every document (such as function words like particles or articles) and raising the weight of words that appear in only a few documents.

Calculation

The most standard definition is as follows. TF is the proportion of a word within a single document, IDF is the logarithm of the total number of documents divided by the number of documents in which the word appears, and the two are multiplied to produce the final score.

tf(t, d)   = (문서 d에서 단어 t의 등장 횟수) / (문서 d의 전체 단어 수)
idf(t, D)  = log( N / df(t) )
             N      = 전체 문서 수
             df(t)  = 단어 t가 등장한 문서 수
tfidf(t, d, D) = tf(t, d) × idf(t, D)

For example, with a collection of 1,000 documents (N = 1000), a word that appears in all 1,000 documents yields idf = log(1000/1000) = 0, so the final score approaches 0 no matter how high its TF is. Conversely, if that word appears in only 10 documents, idf = log(1000/10) = log(100), a larger value, so the higher its frequency in a given document, the more its score rises. In this way, importance is differentiated by word: common words are suppressed and rare words are amplified.

ComponentWhat it measuresEffect
TF (term frequency)How often a word appears within one documentThe more frequently a word is used, the higher its weight
IDF (inverse document frequency)Rarity across the entire document collectionLowers the weight of common words, raises that of rare words
TF-IDF (product)Relative importance within a documentHighlights the words that characterize that document

SEO Use and Limitations

TF-IDF is a classic metric that has been a standard in search engines, text mining, document classification, and recommendation systems ever since Karen Spärck Jones proposed IDF ("term specificity") in 1972. SEO tools borrow this principle to analyze which words top-ranking competitor documents use comparatively often, then suggest candidate words to reinforce in your content.

That said, the common belief that "Google uses TF-IDF as a direct ranking factor" calls for caution. Google's John Mueller has described TF-IDF as "a pretty old metric, and things have evolved quite a bit over the years — there are lots of other metrics," and Search Engine Journal concluded that it is "definitely not" a ranking factor. The reasons cited are that (1) TF-IDF alone cannot meaningfully distinguish among the millions or billions of documents that contain the same word, (2) Google uses more sophisticated methods such as word vectors, cosine similarity, natural language processing, and intent and context matching, and (3) computing TF-IDF scores properly would require Google's entire index, making it hard for an individual site to optimize against directly.

In practice, treating TF-IDF as a direct optimization target is not recommended. Pushing up raw word frequency tends to slide into hitting a keyword density target, and from there into keyword stuffing. Because the core principle of "frequency and document rarity" underlies every modern search engine, TF-IDF is best used as a reference framework for checking which key words and related vocabulary your content should cover, rather than as a score to chase directly.

References and Sources

Related terms

The site becomes easier to read

The content becomes clearer

The brand gets discovered in more customer questions

See how Search OS works, starting with the product deck.