Analysis results
Selected N-gram contexts
Statistical interpretation
| Rank | N-gram | N | Count A | Count B | Difference | Relative A | Percent A | Cumulative | First position | Document frequency |
|---|---|---|---|---|---|---|---|---|---|---|
| No calculated results. | ||||||||||
How to use this calculator
Paste text or upload a supported file. Choose word, character, or custom token analysis. Set one N value or analyze a range.
Adjust preprocessing before running the calculation. Filters control which N-grams remain visible. Chart settings change the visualization without altering the source text.
Click any result to inspect its contexts. Export tables and charts for reports. Browser storage can preserve your preferred settings.
Example data
| Text | N | Expected repeated N-gram | Count |
|---|---|---|---|
| machine learning improves models and machine learning supports predictions | 2 | machine learning | 2 |
| data data science data | 1 | data | 3 |
| banana | 2 characters | an | 2 |
N-gram analysis guide
An N-gram is a sequence of N neighboring tokens. Word bigrams contain two adjacent words. Character trigrams contain three adjacent characters.
Smaller N values reveal broad vocabulary patterns. Larger values capture phrases and local context. Very large values often produce sparse results.
N-grams support language models, search, spam detection, classification, authorship analysis, autocomplete, and sentiment analysis. Preprocessing choices strongly affect every reported frequency.
Frequently asked questions
What is the best N value?
Start with bigrams for phrases and unigrams for vocabulary. Try several values when context matters.
Should stop words be removed?
Remove them for content-focused exploration. Keep them when grammar and phrase structure matter.
Why prevent N-grams crossing sentences?
Cross-sentence sequences are often accidental. Sentence protection produces more meaningful language patterns.
When are character N-grams useful?
They help with spelling variation, language identification, noisy text, and morphology.
What does document frequency mean?
It counts how many analyzed documents contain an N-gram at least once.
Why do totals change after preprocessing?
Removed tokens and altered boundaries change every available sequence and denominator.
What is a Zipf chart?
It plots rank against frequency, often revealing a steep power-law-like decline.
Can this compare two documents?
Yes. Enable comparison, add text B, and select a comparison chart.
Is uploaded text sent anywhere?
No. This page processes supported text files inside your browser.