MarkPrep

Token counter for documents

Drop a PDF, Word file or spreadsheet to see its estimated token count for GPT, Claude and Gemini models before you paste it.

Drop files, paste, or click to browse
PDF, Word, Excel, PowerPoint, HTML, CSV, JSON, EPUB, images and more. Nothing is uploaded.
Live count of requests to other websites during conversion: 0To see for yourself, press F12, open the Network tab and convert a file.

The token counter works on the file itself instead of pasted text. It converts the file to Markdown in your browser and counts the tokens in that Markdown. Every count is an estimate and is marked approx. OpenAI models are counted with the o200k_base encoding. Claude models are estimated at about 2.5 characters per token, and Gemini models at about 4. Pick a model from the list, and the token counter shows whether the document fits that model's context window.

The figures come from each company's own documentation: OpenAI's tiktoken encoding list, Anthropic's model overview and token counting guide, and Google's Gemini token guide.

Frequently asked questions

Which models does the token counter list?+

Claude Sonnet 5.5, Claude Opus 5.5, Claude Haiku 5.5, Claude Fable 5.1, GPT-6 Luna, GPT-6.1 Sol, GPT-6 Astra, Gemini 3.8 Flash, Gemini 3.1 Pro. Pick one from the Model list and the count and the fit answer update.

Are the token counts exact?+

No. OpenAI hasn't said which encoding the GPT-6 models use, so MarkPrep counts them with o200k_base, the encoding of GPT-4o and GPT-5. Anthropic and Google count tokens only through their own APIs and publish no tokenizer a browser can run. MarkPrep works out Claude and Gemini counts from characters per token instead.

Why do models give different counts for the same file?+

Each AI company splits text into tokens with its own tokenizer, so the same file gives a different count for each model family. For example, Claude's current tokenizer makes about 30 percent more tokens from the same text than earlier Claude models did. On that tokenizer, 1 million tokens is roughly 2.5 million characters.

Which files can I count?+

PDF, Word (.docx), Excel (.xlsx and .xls), CSV, PowerPoint (.pptx), HTML, JSON, XML, EPUB, Jupyter notebooks, text and Markdown files. PNG, JPG and WEBP images are read with English OCR.

What if the document doesn't fit?+

The token counter turns red and shows how many tokens over the limit the document is. It also links to the chunk preview, where you can split the document and export the chunks as JSONL.