Docuboxer
By Sergio Alonzo Piña··7 min read

How Many Tokens Is My Document? ChatGPT and Claude Limits

How to tell whether a document fits in the prompt, what it costs for the model to read it, and what to change in the file before you paste it.

To find out whether a document fits in ChatGPT or Claude, count its tokens and compare the total with the model's context window, leaving room for the reply. If it doesn't fit, or costs more than you want, convert it to Markdown, cut what the model doesn't need and count again. You can run all of that on your own file with the token counter and Word to Markdown. Both work in your browser, are free, and never upload the document.

How many tokens is a document, really?

A token is the chunk of text a model reads: a short word, part of a long one, a punctuation mark or a space. Anthropic's rule of thumb for English is about 4 characters per token, or 0.75 words. That puts 1,000 words at roughly 1,300 tokens, and 500 words (about a page) at roughly 670.

The rule drifts quickly. Code, tables, numbers and languages other than English all take more tokens per word, and different models count differently. For OpenAI models you can count exactly, because the tokenizer is public: the token counter uses o200k_base (GPT-4o, GPT-4.1, GPT-5) and cl100k_base (GPT-4, GPT-3.5), the same encodings as tiktoken. Claude is the catch. Anthropic doesn't publish its tokenizer, and says Claude 4.7 and later models produce about 30% more tokens than earlier ones for the same text. So any number you see for Claude without an API call is an estimate. The tool shows it with a "≈" and a range instead of pretending otherwise. It is only a guide: on code and tables the error can pass 25%.

Which model's context window can hold it?

The context window is everything the model can keep in view at once: your document, your instructions, earlier messages and the reply it writes. These are the windows of the models people use most, from each provider's documentation on October 6, 2026:

ModelContext window
GPT-4o128,000 tokens
GPT-5400,000 tokens
GPT-4.11,047,576 tokens
GPT-5.51,050,000 tokens
Claude Haiku 4.5200,000 tokens
Claude Sonnet 5.5, Opus 5.5 and Fable 5.11,000,000 tokens

Fitting isn't the same as working well. Anthropic's own documentation warns that more context isn't automatically better: as the token count grows, accuracy and recall degrade. If you need one clause from a 200-page contract, pasting the clause beats pasting the contract.

Go over the limit through the Claude API and you get a 400 error, "prompt is too long". In a chat app, behavior depends on the product, which may trim or index the file, and you often only notice when the answer ignores part of it.

What does it cost to have a model read your document?

Input cost is one multiplication: tokens times the price per million. Using the input prices published on October 6, 2026, a 100,000-token document costs $0.25 on GPT-4o ($2.50 per million). On Claude Haiku 4.5 ($1 per million) it would be about $0.12, allowing for Claude producing more tokens than GPT for the same text.

GPT-5.5 has a catch. Once a prompt passes 272,000 tokens, OpenAI charges double for input across the whole session, so a 300,000-token document costs $3, not $1.50. The reply is billed separately and prices change often, which is why the tool's table links to each official source.

Why a PDF or Word file weighs more than you'd think

Upload a PDF to Claude and each page is processed as both text and an image. Anthropic estimates 1,500 to 3,000 text tokens per page, plus the image tokens. A 100-page PDF can pass 150,000 text tokens before images are counted, and the API accepts at most 600 pages per request (100 when the request's context window is under 1M).

Two practical consequences follow. If you only need the text, extracting it and pasting that skips the image cost. PDF to Markdown does it in your browser, and why PDFs paste badly into ChatGPT explains what breaks when you copy and paste instead. And if the file is a Word document, convert it to Markdown before handing it to an AI.

Markdown versus HTML: a measurement

A Word table pasted as HTML carries tags the model must read one by one. We counted a 5-row, 3-column table with GPT's o200k_base tokenizer: the header (Producto, Cantidad, Precio) and four data rows (Café, 2, 45.50; Té, 10, 20; Pan, 3, 8; Leche, 6, 30). Each row sat on one line, with no indentation in the Markdown and two spaces of indentation in the HTML:

  • As HTML (<table>, <tr>, <th>, <td>): 128 tokens.
  • As Markdown (pipes and a separator row): 54 tokens.
  • Tab-separated: 34 tokens.

A five-line block (the heading "Informe", a paragraph "Resumen con negrita." with the word in bold, and a two-item list, "Uno" and "Dos") came to 40 tokens as HTML (<h1>, <p>, <strong>, <ul>, <li>) and 16 as Markdown. These are small samples, not an average over real documents, but the gap repeats because HTML tags burn tokens and Markdown replaces them with a couple of symbols. Markdown also keeps headings, lists and tables, which is what helps a model find its way around.

Word to Markdown turns headings into #, lists into bullets and tables into GFM tables, and keeps links. You can drop the images, embed them or take them in a ZIP, and it reports the token count of the result.

From file to prompt, step by step

  1. Count the original in the token counter and check the percentage of each model's window.
  2. Convert it: a .docx goes through Word to Markdown, a text-based PDF through PDF to Markdown. A scanned PDF has no text to extract and needs OCR first. Keep in mind that, for a PDF, the counter counts only the extracted text: it does no OCR and doesn't count image tokens.
  3. Remove what the model doesn't need: cover pages, tables of contents, repeated legal notices, signatures.
  4. If it still doesn't fit, split it by headings and ask part by part, or request a summary of each section first.
  5. Count again. Leave space for the answer, since it counts toward the same window.
  6. Before pasting anything with personal data, decide what to cut. Counting and converting in your browser doesn't expose the file, but whatever you paste into a chat does reach the provider.

Frequently asked questions

How many tokens is one page of text?

A page of about 500 English words is roughly 650 to 670 tokens. A PDF uploaded to Claude counts 1,500 to 3,000 text tokens per page plus the page image, so the same content costs more as a PDF than as text.

What happens if my document doesn't fit in the context window?

The Claude API rejects the request with a 400 error. In a chat app, the product may trim or index the file and the answer ignores parts of it. Trim the text, split it by section, or choose a model with a larger window.

Does Markdown really use fewer tokens?

In our measurement, a table went from 128 tokens as HTML to 54 as Markdown. The saving depends on the document, and the surest way to know is to count the result, which the tool does for you.

Is the Claude token count exact?

No. Anthropic doesn't publish its tokenizer, and an exact count needs a call to its API with a key. Docuboxer estimates from the GPT count and marks it with "≈". Claude 4.7 and later models produce about 30% more tokens than earlier ones.

Is my document uploaded when I count or convert it?

No. Counting and conversion happen in your browser and the file isn't uploaded. What does leave your computer is whatever you paste into the AI chat afterwards.

Count the tokens in your document

Paste text or upload a .docx or PDF and compare each model's context window and cost. Free, and it never leaves your browser.

Open Token Counter →

Related tools