Home / Free tools / GPT token counter (estimate)
GPT token counter: estimate tokens in a prompt or document
Paste the text you are about to send (or a document you want to summarise). The tool estimates tokens with a cl100k / o200k-style heuristic, shows characters and words, and checks common context windows. It is not OpenAI’s tokenizer and it does not price a request — use the token cost estimator for that.
How to use it
- Paste the text you will actually send. A system prompt, a document, a transcript, or all of them together if they go in one request.
- Reserve space for the reply if it must fit in the same window. A long answer needs headroom on smaller context windows.
- Read the estimate as a range. It is close enough to see whether you should cut the prompt, not close enough to audit a bill.
- For money, use a cost estimator and your vendor’s rate card. This page does not multiply tokens by a price.
Why a counter that is not a tokenizer is still useful
Vendors bill and truncate in tokens, not words. A 3,000-word brief can be 4,000 tokens or 6,000 depending on punctuation, code and language. You do not need a perfect count to decide whether a document will fit in an 8k window, or whether you should summarise it first. You do need a perfect count if you are reconciling an invoice — this page is not that. Official tokenizers (tiktoken for many OpenAI models, or the vendor’s own library) are the source of truth, and they change when the vocabulary changes.
What usually inflates a count
- Pasting an entire thread or HTML page when a short extract would do.
- Repeating the same policy block in every call instead of a cached prefix, where the API supports that.
- Asking for a long, structured answer on a small context window so the model has no room to work.
The Usage & Cost-Reduction Guide on hackerdb Labs is about the habits around this: shorter prompts that keep the result, routine frequency, and a monthly usage review. There is also a Cost Audit & Model Routing Playbook if you are comparing models, not just counting one prompt.
Worked example
This is what the tool produces for the sample input, so you can see the result without running it.
Input
You are a careful editor. Shorten the following memo to six bullet points, keep every number, and flag anything that is an opinion rather than a fact. MEMO The team shipped version 2.1 on 12 November. Support tickets fell 18% week on week, but three enterprise accounts still report a timeout when they export more than 50,000 rows. Please decide whether we hotfix this week or wait for 2.2 on 4 December.
Result
Estimated 188 tokens in the pasted text, plus 500 reserved for a reply, is about 688 tokens in the window.
| Measure | Count |
|---|---|
| Characters (including spaces) | 406 |
| Words | 72 |
| Lines | 4 |
| Estimated tokens | 188 |
| Characters per estimated token | 2.16 |
| Estimated tokens per word | 2.61 |
| Context window | Size | If you send this text + reserved reply |
|---|---|---|
| GPT-3.5 / older 4k models | 4,096 tokens | Fits, ~3,408 left |
| 8k context | 8,192 tokens | Fits, ~7,504 left |
| 16k context | 16,384 tokens | Fits, ~15,696 left |
| 32k context | 32,768 tokens | Fits, ~32,080 left |
| GPT-4o / 4.1 class (128k) | 128,000 tokens | Fits, ~127,312 left |
| 200k-class models | 200,000 tokens | Fits, ~199,312 left |
This is a heuristic, not tiktoken or a vendor tokenizer. English usually lands near four characters per token; code, URLs and CJK can differ. Counts can be off by roughly 10–20%. It does not know your model’s exact vocabulary, and it is not a price — pair it with the token cost estimator if you have a published rate per million tokens.
Frequently asked questions
Is this the same as OpenAI’s tokenizer?
No. It is a local estimate. For exact counts, use the vendor’s tokenizer or a library such as tiktoken for the models it supports.
Does it cover Claude, Gemini or Grok?
The estimate is in the same ballpark for English, but every model has its own vocabulary. Use this to see if something is large, not to compare vendors to the token.
Why is this separate from the cost estimator?
That tool prices a run from a token count and a rate card. This one starts from raw text.
Is the text uploaded?
No. It never leaves your browser.
More free tools
- LLM token and cost estimator: Estimate tokens from pasted text and project the cost of an agent or prompt per run, per day and per month, with cached-input discount and growing context.
- AGENTS.md generator: Generate an AGENTS.md for your repo: exact commands, conventions, boundaries and safety rules for coding agents. Defaults for Node, Python, Rust, Go, Solidity.
- Prompt injection and hidden text scanner: Paste a skill, README, web page text or tool output. Finds invisible Unicode, instruction-override phrases, hidden comments, risky commands and encoded blobs.