Free, no sign-up, runs in your browser

Token counter for text and files (OpenAI, Claude, Gemini)

Paste text or drop a PDF, Word, Excel, CSV or Markdown file to count its tokens. OpenAI counts are exact, Claude and Gemini counts are clearly marked estimates, and a table shows which models it fits and what one call costs.

How it works

Paste your text, or choose a PDF, Word, Excel, CSV, Markdown or TXT file. It stays in your browser.

Read the exact OpenAI token counts and the Claude and Gemini estimates.

Set the room you want to leave for the answer and check which models it fits and the input cost.

Exact OpenAI counts

Counts with OpenAI's own encodings, o200k_base and cl100k_base, on your device. Big texts are counted in a background worker, so the page stays responsive.

Claude and Gemini estimates, clearly marked

There is no offline tokenizer for current Claude or Gemini models, so these are estimates from the providers' published ratios, shown as a range, with links to their exact counting APIs.

Does it fit, and what does it cost?

A dated table of current OpenAI, Claude and Gemini models shows the context window, the share your text uses, whether it fits with room for the answer, and the input cost at list price.

Questions

How exact are the counts?

OpenAI counts are exact for the o200k_base and cl100k_base encodings. Claude and Gemini counts are estimates based on the providers' published words and characters per token, so they are shown as a range.

How do I get an exact Claude count?

Anthropic offers a free token counting API that gives the exact count for a given Claude model. Google's Gemini API has a countTokens method for Gemini models. This page links to both providers' documentation.

Can I count tokens in a PDF?

Yes. The text inside the PDF is counted, with tables written as Markdown tables. Chat apps may also count each PDF page as an image, which adds tokens. Scanned PDFs have no text, and the tool says so.

Is my text or file uploaded?

No. Counting happens in your browser. The only downloads are the tokenizer files from this site, and your text is never sent anywhere.

How current are the models and prices?

The table shows the date it was last checked against the providers' model and pricing pages, with links to each source. Prices are list prices for input tokens, without caching or batch discounts.

More free tools

All tools