DocuPruneBack to DocuPrune

Plan a document's token budget before using AI

Clean Markdown reduces formatting noise, but a smaller document is not a promise of lower cost or better answers. Measure the exact text you intend to send and leave room for the rest of your conversation.

العربية

Open the converter

How to do it

  1. Review the final text

    Convert and review your document first. Remove irrelevant sections deliberately, and check that important tables and context remain. Copying an edited result changes what should be counted.

  2. Read the count method

    Review offers local exact counts for o200k_base and cl100k_base. These are specific encodings, not a universal count for every model. Other supported model choices use clearly labelled estimates.

  3. Include the whole request

    Your instructions, previous messages, any tool context and the model's reply also occupy context. Count the export template you actually use and allow a margin when the model's tokenizer differs.

  4. Split long results carefully

    Split export can produce smaller parts. Give each part enough context to be understood, retain filenames and ordering, and inspect boundaries before sending parts to an AI tool.

A worked example

Illustrative context planning, not a measured tokenizer result or a price estimate.

What goes in

Model context: 32,000 tokens
Document target: 26,000 tokens

What comes out

Document: up to 26,000
Reserve: 6,000 for instructions, history and response
Verify the actual model and final text

Use a short sample and compare an edited result with the original. Always read whether the displayed count is exact or estimated.

What it will not do

  • An exact encoding count does not guarantee the count used by an unrelated model.
  • Document counts do not include hidden provider instructions and are not an API bill.
  • Cleaning may remove useful context if applied without review.

Questions

Is all counting local?
Counting runs in your browser. Loading an encoder may fetch program resources; your document is not sent for counting.
Does fewer tokens guarantee better answers?
No. Preserve the information and relationships needed for the question. Smaller irrelevant text can help, but missing evidence can hurt.

Where your file goes

Nowhere. Reading, converting, cleaning and counting all happen in this browser tab, on your own device. The file, its name and its text are never uploaded to a server, and there is no account to create.

One thing does use the network, and it is worth being precise about: reading a scanned page needs an OCR model, which downloads from this site the first time you convert an image or a scan. That is a program arriving on your device, not your document leaving it. After it has been fetched once, that conversion works offline.

Open the converter