MarkdownPDF

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

Your file never leaves your device

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:

ContentTypical tokens
English proseabout 1.3 tokens per word (roughly 4 characters per token)
1,000 words of Englishabout 1,300 tokens
A dense page of a PDFabout 500 to 800 tokens of text
Code, JSON, tables of numbersnoticeably 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

  1. Drop the PDF, Word, Markdown, HTML, CSV or text file on the counter above.
  2. 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.
  3. 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

Guides