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.
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
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
- Markdown Chunker for RAGSplit documents into token-sized chunks that respect headings.Markdown, Text, PDF, Word (.docx) → JSONL, Markdown (.md), ZIP
- Split PDF for AICut a PDF into parts NotebookLM, ChatGPT or Claude will accept.PDF → PDF parts, ZIP
- PDF to MarkdownClean Markdown from any PDF, with OCR for scanned pages.PDF → Markdown (.md)
- Word to MarkdownTurn a .docx into clean Markdown — headings, lists, tables, images.Word (.docx) → Markdown (.md), ZIP
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.
- AI File Upload Limits in 2026 — NotebookLM, ChatGPT, Claude, GeminiWhat NotebookLM, ChatGPT, Claude and Gemini actually accept per file, what happens when you go over, and the two fixes that work - with sources and dates.
- 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.