Token Counter
How many tokens is this prompt, this PDF, this Word document? Exact counts with OpenAI's tokenizers, an honest estimate for other models, and nothing uploaded.
- Tokens — GPT-4o, GPT-4.1, o-series
- 0
- exact · o200k_base
- Tokens — GPT-4, GPT-3.5
- 0
- exact · cl100k_base
- Tokens — Claude, Gemini, others
- 0
- estimate, see below
- Words · characters
- 0 · 0
- 0 lines
Drop a PDF, Word or text file, or browse
OpenAI counts use OpenAI's own tokenizer, so they match how those models split this text (an API request adds a few tokens of message formatting). Anthropic and Google do not publish their tokenizers for use in a browser, so the third figure is a range (0.9× to 1.35× the o200k count), not a measurement. Too long for your AI tool? Split it into chunks.
Why count tokens?
Context windows, rate limits and prices are all measured in tokens, and words are a poor proxy: the same 1,000 words can be 1,300 tokens of English prose or 3,000 tokens of JSON. Counting before you paste tells you whether a document will fit, how much of the context it leaves for the answer, and what an API call will cost.
OpenAI, Claude and Gemini count differently
Every model family has its own tokenizer, so the same text is a different number of tokens in each. OpenAI publishes its tokenizers, which is why this counter gives exact figures for GPT-4o, GPT-4.1 and the o-series (o200k_base) and for GPT-4 and GPT-3.5 (cl100k_base). Anthropic and Google do not ship tokenizers that run offline: an exact Claude token count comes from Anthropic's token-counting API endpoint, and an exact Gemini count from the Gemini API's countTokens method — both of which mean sending the text to them. Here, Claude and Gemini get a range derived from the OpenAI count instead, clearly marked as an estimate.
Rules of thumb
Useful for a first guess, never for a bill — the exact figure depends on the text and the tokenizer:
| Content | Typical tokens |
|---|---|
| English prose | about 1.3 tokens per word (roughly 4 characters per token) |
| 1,000 words of English | about 1,300 tokens |
| A dense page of a PDF | about 500 to 800 tokens of text |
| Code, JSON, tables of numbers | noticeably more per word than prose |
| Non-Latin scripts (Arabic, Chinese, Hindi…) | often several times more than English for the same meaning |
How to count the tokens in a PDF or Word file
- Drop the PDF, Word, Markdown, HTML, CSV or text file on the counter above.
- Its text is extracted in your browser — scanned PDF pages go through OCR — and placed in the text box, where you can trim what you do not need.
- Read the counts: exact for OpenAI models, a range for Claude and Gemini, plus words, characters and lines.
Only the text is counted. When you upload a PDF to ChatGPT, Claude or Gemini, page images may be sent to the model as well and add their own tokens, so treat the figure as the minimum.
Make documents cheaper to read
Format matters as much as length. A PDF pasted as raw text carries broken lines, headers and footers on every page; the same document as clean Markdown is usually shorter and easier for a model to follow — see why LLMs prefer Markdown. Convert with PDF to Markdown or Word to Markdown, then count again.
Frequently asked questions
Still stuck? Ask us.
What is a token?
The unit language models read and bill by. A tokenizer cuts text into common fragments: a frequent English word is often one token, a rare word several, and punctuation, digits and spaces count too. On typical English prose, one token is about three quarters of a word; code, numbers and many non-Latin scripts use more tokens per word.
How exact are the numbers?
The two OpenAI counts use OpenAI’s published tokenizers — o200k_base (GPT-4o, GPT-4.1 and the o-series) and cl100k_base (GPT-4, GPT-3.5 and the text-embedding-3 models) — so they are exact for the text itself. An API request adds a few tokens of message formatting on top.
Why is Claude or Gemini only an estimate?
Anthropic and Google do not publish tokenizers that can run offline in a browser; exact counts come from their APIs, which would mean sending your text to them. The range shown (0.9× to 1.35× the o200k count) covers typical differences between modern tokenizers — treat it as a planning figure, not a bill.
Can I count the tokens in a PDF?
Yes. Drop the PDF and its text is extracted exactly as PDF to Markdown would do it — with OCR for scanned pages — and then counted. Word, HTML, Markdown, CSV, JSON and plain-text files work too.
Is my text sent anywhere?
No. The tokenizer is downloaded from this site once (about 2 MB, then cached) and runs in your browser, in a background thread so typing stays smooth. Your text never leaves your device.
My document has too many tokens. What now?
Split it. The Markdown Chunker cuts text into pieces of a set token size at headings and paragraphs; Split PDF for AI cuts a PDF into parts that fit ChatGPT, Claude, NotebookLM or Gemini upload limits.
Limitations
- Exact counts for OpenAI tokenizers only; Claude, Gemini and open models are estimated.
- Images inside documents are not counted — only their text.
- The tokenizer (about 2 MB) is downloaded the first time you use the tool.
Related tools
Guides
- How to Chunk Documents for RAG: Sizes, Overlap and StructureA practical guide to splitting documents for retrieval-augmented generation - chunk sizes, overlap, heading context, and why structure beats fixed-size splits.
- ChatGPT, Claude, NotebookLM & Gemini File Upload Limits (2026)ChatGPT, Claude, NotebookLM and Gemini upload limits by plan - file size, files per chat, per 3 hours and per project. Checked against vendor docs.
- Why LLMs Read Markdown Better Than PDF (ChatGPT & Claude)PDF extraction throws away the structure your model needs. See what breaks, and why Markdown gets better answers out of ChatGPT and Claude.
- Convert PDF to Markdown for ChatGPT (Step-by-Step)Learn how to convert a PDF to Markdown for ChatGPT. Get cleaner answers, save tokens, and handle long documents with heading-based chunking.