← All text tools

TF-IDF Calculator

Paste several short documents and get term frequency, inverse document frequency and TF-IDF for every word as a sortable table, with a choice of TF and IDF formulas.

  • Free
  • No sign-up
  • Works on any device

About TF-IDF Calculator

TF-IDF scores how important a word is to one document compared with a set of documents. Term frequency counts the word in a document and inverse document frequency is ln(N divided by the number of documents that contain it), so a word in every document scores 0. In three documents, a word in two of them has an IDF of 0.4055. Paste your documents and get the full table, sortable by any column, with a choice of formulas.

How to use TF-IDF Calculator

  1. Paste your documents, one per line or separated by blank lines.
  2. Choose the TF and IDF formulas and whether to ignore common words.
  3. Read the table, click a heading to sort, or pick one document for the detail.

Why use this tool?

Also known as

Frequently asked questions

Why does the word the score 0?

With the plain formula, a word found in every document has an IDF of ln(1), which is 0, so it carries no information for telling the documents apart.

What is the smoothed IDF?

It uses ln((1 + N) / (1 + df)) + 1, the form popular in machine learning libraries, so a word found everywhere still gets a small positive weight.

Does it stem or remove punctuation?

Words are lower-cased and split on spaces and punctuation. There is no stemming, so run and running count as two terms.

Is TF-IDF Calculator free?

Yes. TF-IDF Calculator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put TF-IDF Calculator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.