Word Frequency Calculator

Explore word counts, n-grams, TF-IDF, lexical diversity, document similarity, visual charts, and export-ready machine-learning features from any text in seconds for practical analysis workflows.

Text and document input

Analyse one document or compare several documents.

Cleaning and normalisation

Tokenisation and words

Stop words

Frequency and TF-IDF

N-gram settings

Vocabulary and matrices

Formula used

Relative frequency = word count ÷ total valid words
Percentage = relative frequency × 100
Normalised frequency = word count ÷ highest word count
IDF = ln(document count ÷ document frequency) + 1
TF-IDF = term frequency × inverse document frequency
Cosine similarity = vector dot product ÷ vector magnitudes

How to use the calculator

  1. Paste text or upload supported document files.
  2. Add documents when comparison or TF-IDF is required.
  3. Select cleaning, tokenisation, and stop-word options.
  4. Choose frequency, n-gram, and vocabulary settings.
  5. Press the analysis button to generate results.
  6. Review tables, matrices, similarities, and visual charts.
  7. Copy or export results in your preferred format.

Example data

Example textWordCountRelative frequencyPercentage
Machine learning learns patterns. Machine learning uses data.machine20.2525%
Machine learning learns patterns. Machine learning uses data.learning20.2525%

Frequently asked questions

What is word frequency?

Word frequency counts how often each token appears. It supports text exploration and feature creation.

How does TF-IDF differ from frequency?

Frequency measures repetition within text. TF-IDF reduces scores for widely shared terms.

Why remove stop words?

Stop words can dominate results without adding meaning. Removing them highlights more informative vocabulary.

What are n-grams?

N-grams are consecutive sequences of tokens. They reveal common phrases and contextual patterns.

What is lexical diversity?

Lexical diversity compares unique words with total words. Higher values indicate broader vocabulary use.

Can several documents be compared?

Yes. Add documents to calculate document frequency, TF-IDF, matrices, and cosine similarity.

What is a document-term matrix?

It stores document rows and vocabulary columns. Values represent counts or binary word presence.

Does stemming equal lemmatisation?

No. Stemming trims endings mechanically. Lemmatisation attempts to return a meaningful base form.

Which files are supported?

The calculator accepts TXT, CSV, and JSON files. Each file is processed as readable text.

Related Calculators

Cosine Text Similarity CalculatorJaccard Text Similarity CalculatorLevenshtein Distance CalculatorBLEU Score CalculatorROUGE Score CalculatorPerplexity CalculatorVocabulary Size CalculatorToken Count CalculatorText Classification Metrics CalculatorNatural Language Processing Basics Quiz

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.