Generate Text N-grams
List all n-grams of a chosen size from the text. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
0 chars · 0 lines
Output
List all n-grams of a chosen size from the text.
Type or paste above to see the result here.
What you paste never leaves this tab
Generate Text N-grams is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.
- No upload
- No length limit
- Works offline once loaded
- Nothing stored or logged
How to use Generate Text N-grams
- 1. Paste the source text. Paste or type the passage into the input pane. Generate Text N-grams reads it and prepares to slide a window of a chosen size across the tokens.
- 2. Set N and choose Words or Characters. Enter the gram size in the N field, such as 3 for trigrams, and pick whether that window slides over Words or Characters depending on the kind of pattern you're after. Set Show to Frequency table to count each gram, and keep Lowercase and strip punctuation on so "Fox." and "fox" match.
- 3. Copy the n-gram list. Click copy on the output pane and use the resulting overlapping sequences for a language model feature set, a plagiarism check or a shingle-based comparison.
When to use Generate Text N-grams
Generate Text N-grams slides a window of any size across a passage's words or characters and lists every overlapping sequence it produces. Adjusting N lets you move between short pairs and longer, more specific phrase patterns in one tool.
- Building n-gram features for a text classifier. A spam or sentiment classifier often uses word trigrams as features. Setting N to 3 and Tokens to Words produces the exact overlapping sequences a training pipeline expects.
- Generating shingles for near-duplicate detection. Detecting near-duplicate documents typically compares overlapping character shingles, often 5 or more characters long. Setting N and Tokens to Characters produces that shingle set for a similarity check.
- Testing plagiarism-detection overlap. Checking how much two essays overlap can start by comparing their word n-grams at a chosen size. Generating both lists here makes a manual side-by-side comparison much faster.
Examples
Word trigrams
Input
the quick brown fox
Output
the quick brown quick brown fox
About the Generate Text N-grams tool
Generate Text N-grams is a free online tool that works entirely inside your web browser. List all n-grams of a chosen size from the text. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 211 Text utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
You can shape the output with 5 settings, including N (gram size), Tokens, Show and Lowercase and strip punctuation, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every step is handled on your own machine rather than by a remote API.
Frequently asked questions
Is Generate Text N-grams free to use?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
How much text can I process at once?
There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I use the result?
The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.