AI Token Tools
File Token Counter — Count Tokens in PDF, Word, Excel & Images
Count the tokens in a whole file. Drop a PDF, Word document, Excel sheet, text file or image and see how many tokens it is for ChatGPT/GPT-4o, Claude, Gemini, DeepSeek and Llama — everything is read locally in your browser.
- Supported files
- PDF · DOCX · XLSX · TXT/MD/CSV · images
- Text accuracy
- GPT exact (tiktoken)
- Images
- Estimated vision input tokens
- Privacy
- Parsed in your browser
About this tool
Pasting a long document into a token counter is awkward. This tool reads the file for you: it extracts the text from PDFs, Word and Excel files (and plain text or code), then counts the tokens exactly the same way the model would — so you know before you send whether it fits the context window and what it may cost.
Everything runs in your browser. The file is opened locally with JavaScript and the text is never uploaded to a server. OpenAI/GPT counts use the exact tiktoken encoding; Claude, Gemini, DeepSeek and Llama are close estimates.
For images, models don't read pixels as text — they bill a number of input tokens based on the image's dimensions. This tool estimates those vision tokens for the major models so you can budget image prompts too.
Which file types are supported
Text-based files have their text extracted and counted exactly: PDF (digital, not scanned), Word .docx, Excel .xlsx/.xls/.csv, and plain .txt/.md/code files. Scanned PDFs or photos of text contain no selectable text, so they count as an image (vision tokens) rather than extracted words.
How image (vision) tokens are counted
Vision models split an image into tiles and charge a base cost plus a cost per tile, scaled to the image's width and height — so a larger image costs more tokens. The figure shown here is an estimate of those input tokens per model; the exact number can vary slightly with each provider's current formula and your detail setting.
Why count a file's tokens before sending it
Long PDFs and spreadsheets can blow past a model's context window or run up a surprising bill. Counting first tells you whether to split the document, summarise it, or pick a model with a larger context window — and lets you forecast the API cost up front.
How to use
- Drop or choose a file — Drag a PDF, Word, Excel, text or image file onto the box, or click to browse.
- Read the token count — The text is extracted in your browser and counted live, with a per-model comparison.
- Pick the model — Switch models to see the exact GPT count or the estimate for Claude, Gemini, DeepSeek and Llama.
- Act on the number — Split, summarise or choose a bigger context window if the file is too large.
Frequently asked questions
Can I count tokens in a PDF?
Yes. Drop a text-based (digital) PDF and the tool extracts its text in your browser and counts the tokens. Scanned PDFs have no selectable text, so they are treated as images.
Does it work for Word and Excel files?
Yes — .docx Word documents and .xlsx/.xls/.csv spreadsheets are read locally and their text is counted. Legacy binary .doc may not extract cleanly; save as .docx for best results.
How are image tokens counted?
Images are billed by vision models as input tokens based on their dimensions. The tool estimates those tokens for each model from the image's width and height.
Is my file uploaded anywhere?
No. The file is opened and parsed entirely in your browser with JavaScript — nothing is sent to a server or stored.
Is the file token count exact?
For extracted text, OpenAI/GPT counts are exact (tiktoken); other models are close estimates. Image vision-token counts are estimates for every model.
Is there a file size limit?
There is no hard limit, but very large files are parsed in your browser, so a huge PDF or spreadsheet may take a few seconds and use more memory.