Free token counter

Paste text or drop a file to get the exact OpenAI token count, a Claude estimate, and a quick check against common context window sizes. It runs in your browser, so your document never leaves your device.

How it works

  1. 1

    Paste text or drop a file

    A prompt, a chapter, a whole handbook. PDF, Word, Markdown, CSV, HTML and plain text all work.

  2. 2

    Your browser does the counting

    The file is read on your device and run through the same tokenizer OpenAI uses. Nothing is uploaded, so private documents stay private.

  3. 3

    See what fits

    Get exact OpenAI token counts, a Claude estimate, words, characters and pages, and a quick check against common context window sizes.

What a token is

Models don't read words; they read tokens, which are chunks of text from a fixed vocabulary. Common English words are usually one token, longer or rarer words get split into pieces, and spaces and punctuation count too. A rough average for English is about four characters, or three-quarters of a word, per token. Code, numbers, tables and most other languages use more.

Every context window, rate limit and API bill is measured in tokens, so a word count only gets you close. When you need to know whether a prompt fits, or how much of a document a model can take in at once, count the tokens. For word counts, page stats and reading time across several PDFs at once, use the PDF word counter.

Why ChatGPT and Claude give different numbers

Each model family has its own tokenizer. OpenAI publishes its tokenizers, which is why this page can match OpenAI's count exactly: o200k_base for current models, and the older cl100k_base for GPT-4 and GPT-3.5. The newer encoding has a bigger vocabulary, so the same text usually takes fewer tokens, especially outside English.

Claude uses a different tokenizer that Anthropic doesn't release for offline use. The Claude figures here are estimates based on Anthropic's published rule of thumb. Treat them as a planning number, not an exact one.

Token counts and knowledge files

When you give ChatGPT or Claude a document to work from, the token count tells you how it will be handled. A file that fits in the context window can be read whole. A larger one gets searched, and the model works from the passages the search picks out. Knowing the count tells you which of those you are dealing with.

Smaller, clean files are easier to work with. If a document is far over the window, split it into focused files and strip out the page furniture first. Here is how to pick a chunk size, or run one file through the free knowledge base builder, which cleans and splits it for you.

Frequently asked questions

Is this an exact OpenAI token count?
Yes, for the text itself. It uses gpt-tokenizer, an open-source JavaScript port of OpenAI's tiktoken, with the o200k_base encoding (GPT-4o, GPT-4.1, the o-series and GPT-5) and, when you click to show it, cl100k_base (GPT-4 and GPT-3.5). Chat messages and tool definitions add a few formatting tokens on top, so a full API request can come out slightly higher.
How accurate is the Claude token count?
It is an estimate. Anthropic does not publish a tokenizer you can run offline. Its pricing docs give a rule of thumb of about 4 English characters per token, and say Claude Opus 4.7 and later produce roughly 30% more tokens for the same text, so we show both. Code, tables and non-English text usually run higher. For an exact number, use Anthropic's token counting API.
Is my file uploaded anywhere?
No. The page reads your file and counts it inside your browser. Nothing is sent to our servers or anyone else's, and nothing is stored. Once the page has loaded, it keeps working even if you go offline.
Why does my PDF count look low, or come back empty?
Only the PDF's text layer is counted, which is also what ChatGPT reads on most plans. A scanned PDF is just pictures of pages with no text layer, so there is nothing to count until it goes through OCR. Headers, footers and page numbers are counted too, which is one reason cleaning a file before upload helps.
Is this a token calculator for API costs?
It counts tokens; it does not price them, because prices change often and differ by model. To estimate a cost, take the token count and multiply by the per-million-token rate on the provider's pricing page. Remember that the reply is billed too, usually at a higher rate.
My document is bigger than the context window. What now?
You can still upload it as a file. ChatGPT and Claude search uploaded files and pull in the relevant passages instead of reading everything at once. OpenAI caps each text file at 2 million tokens. Search works better on clean, smaller files than on one giant export, so split very large documents by chapter or topic.

Need a whole folder turned into clean knowledge files for ChatGPT or Claude? KBP packs from $9 once.

More free tools

PDF Word Counter

Count words in one or more PDF documents, with characters, pages, reading time and exact OpenAI tokens. Flags scanned PDFs. Runs in your browser.

PDF to Markdown Converter

Convert PDFs to clean Markdown with headings, lists and paragraphs rebuilt, and running headers and page numbers removed. Runs in your browser.

Text Splitter

Split long text into chunks by tokens, words or characters, with optional overlap and part labels for ChatGPT or Claude. Breaks at paragraphs and sentences. Runs in your browser.

HTML to Markdown Converter

Convert HTML snippets, full web pages or .html files to clean Markdown with headings, links, lists and tables kept. Runs in your browser.

Remove Line Breaks

Remove line breaks from text copied from PDFs and emails. Keep paragraphs, join everything into one line or use your own separator, and re-join hyphenated words. Runs in your browser.

EPUB to TXT Converter

Convert EPUB ebooks to plain text in your browser. Chapters stay in reading order; nothing is uploaded.

Word to Markdown Converter

Convert Word .docx files to clean Markdown with headings, bold, italics, links, lists and tables kept. Runs in your browser; nothing is uploaded.

AI File Limit Checker

Check file sizes, counts and token totals against the published upload limits for ChatGPT, Claude and Gemini. Runs in your browser; nothing is uploaded.

Markdown Table Generator

Turn CSV, Excel or Google Sheets data into a clean Markdown table with column alignment and escaped pipes. Runs in your browser; nothing is uploaded.

Markdown to PDF Converter

Convert Markdown to a clean PDF with selectable text, keeping headings, lists, tables, code blocks and links. Runs in your browser; nothing is uploaded.

Split PDF

Split a PDF by page ranges, every N pages or one page per file, or extract pages into a new PDF. Pages are copied exactly. Runs in your browser; nothing is uploaded.

Free Knowledge Base Builder

Clean and chunk one file into .txt knowledge files with token counts. Free, no signup, nothing stored.

All free tools →

Related guides