Back to Free Tools
FREE TOOLS
Text N-gram Counter
Count overlapping word or Unicode-code-point sequences and download exact token arrays, frequencies and first positions.
Plain text
JSON
Browser only
Runs locally in your browser. Your files, pasted content and generated output are not uploaded. Reset clears this tool’s working data.
This tool needs JavaScript. If it does not load, refresh the page and try again.
How to use this tool
- Paste Input text, then choose Token mode: word tokens or Unicode code points.
- Set N-gram size from 1 to 8. Case and Unicode spelling remain unchanged.
- Select Count n-grams, then download ngrams.json. Each gram contains a token array, count and firstIndex, a zero-based token-window start.
Examples
Word bigrams for a a a b a b are [a,a] twice, [a,b] twice and [b,a] once, ordered by count then first occurrence.
Limitations
- Up to 200,000 UTF-16 code units of valid Unicode and 50,000 tokens. Size 1–8; at most 50,000 distinct n-grams, 8 MiB stored UTF-8 keys and 20 MiB UTF-8 JSON; 30-second worker deadline.
- Word tokens are maximal Unicode letter/number sequences with combining marks after the first letter or number. Leading combining marks and punctuation separate tokens. No linguistic segmentation, stemming, case folding or Unicode normalization.
- Code-point mode can split a visible grapheme or joined emoji into several tokens. It includes spaces, newlines and joiners. Browser textarea input normalizes pasted line endings to LF.
- Empty input or fewer tokens than the selected size produces a valid empty gram list. The shared text preview is limited to 1,048,576 characters; download the complete JSON.
Related tools
No items found.