AI File Preflight: PDF Token Counter & Text Splitter

Beta · Free browser tool · No account · No AI API calls

Before you send a PDF or document to an AI, check the text you are actually giving it. Extract text locally, count it with a named tokenizer, flag pages with little or unreadable text, and download smaller TXT chunks that fit a budget you choose.

This is a PDF text token counter and text splitter, not a guarantee that ChatGPT, Claude, Gemini or Grok will accept a file. It does not OCR scanned pages, analyze images, reproduce PDF layout, or calculate the provider’s full processed-input bill.

What this file checker tells you

Question What you get What remains unknown
Does this PDF have extractable text? A local extraction preview, pages processed, and low-text or failed-page warnings. A low-text page may be blank, scanned or poorly encoded. This is not an OCR result or proof that every visual detail survived.
How many text tokens does it contain? The normalized extracted-text count using your selected o200k_base or cl100k_base encoding. Another model’s tokenizer, PDF image processing, chat history and request formatting can produce a different total.
Can I break it into usable parts? Individually re-counted TXT chunks, an optional ZIP and a coverage report with text offsets and source-page mapping where available. Splitting can separate a table from its heading or a claim from its exception. You must inspect boundaries and the original.
Will my subscription allow the upload? Links to the relevant upload and length troubleshooting guides below. Account allowances, plan gates, file types, rolling rates, storage, retrieval and provider context management are not measured here.

A reproducible example, not a model benchmark

The tool’s original HiseHub sample contains 1,366 normalized characters and 261 o200k_base text tokens. With the default 4,000-token working budget, 1,000 reserved for a reply and 500 for other input, the additional 20% margin leaves a 2,000-token chunk payload: the sample fits in one chunk.

Change the total to 512, reserve 100 for the reply and 100 for other input, then run it again. The payload becomes 249 tokens and the same sample becomes two chunks, counted as 225 and 36 tokens. These are measured counts from this tool’s fixed sample, not evidence of an AI model’s accuracy or a provider’s allowed upload size.

How to use the chunks without losing the question

  1. Choose a practical budget. Leave room for the answer, your instructions, earlier conversation and any other source material. An advertised maximum context window is not necessarily the available input space in your current chat.
  2. Read the preview. Check names, dates, units, negative wording and tables. If text is missing or the reading order is wrong, export text from the original application or use an authorized local OCR workflow.
  3. Download and use individual chunks. The ZIP is a convenient transport archive; uploading the entire archive does not make an oversized request smaller. The TXT files contain the chunk payload without extra instructions.
  4. Keep a source map. The JSON report lists coverage and each chunk’s normalized text offsets. PDF source-page numbers are included where extraction permits. Keep the original file for verification.
  5. Reassemble evidence before conclusions. Ask the AI to note facts, exceptions and source references for each part. A final synthesis can still miss information across chunks; check the result against the original.

Why text tokens are not the whole PDF cost

A PDF can include extractable text, page images, charts, scans and unusual fonts. OpenAI’s file-input documentation describes text and page-image processing for supported vision models. A text-only count therefore does not equal the API’s full processed PDF input. OpenAI also documents a model-aware input-token counting endpoint, but this local tool does not call it or upload your file. OpenAI file-input processing; model-aware API token counting.

The two selectable encodings are named references implemented with the locally bundled gpt-tokenizer library. Counts are exact for the normalized text and selected encoding, not universally exact for all providers. The 20% margin is an explicitly chosen planning buffer; it is not a measured error band, safety certificate or acceptance guarantee.

For text-API budgeting after you have a token estimate, use the existing AI API Cost Calculator. Do not treat the text count here as the cost of sending an image-heavy PDF. For how subscription and API billing differ, read AI Subscription vs API.

Local processing and privacy boundaries

The processing area runs in a sandbox without same-origin access to the surrounding page. Its network policy blocks file uploads and other connection requests; its code has no analytics SDK and does not access cookies or persistent storage. HiseHub’s hosting layer may set its existing HTTP-only visit cookie on page/code requests; isolated scripts cannot read it. The fixed parser/tokenizer bundle downloads from HiseHub when you first run a check. File names, contents, counts and budgets are not sent to the parent page; only a non-sensitive frame-height message is used for layout.

The surrounding HiseHub page uses the site’s existing visit analytics, as described in the privacy policy. Browser extensions, a compromised browser or device, and anything you later send to an AI provider are outside this tool’s protection. “Local” does not mean absolute confidentiality or malware detection. Clear the workbench to discard its current file, result and download links; closing or reloading also resets it. Secure erasure of device memory is not guaranteed.

PDF parsing uses a locally bundled, version-pinned Mozilla PDF.js implementation with evaluation and external resources disabled. Password-protected and text-copy-restricted PDFs are not unlocked by the tool.

Supported inputs and transparent local caps

  • PDF: text extraction only, up to 100 processed pages. Scans need OCR elsewhere. Little text does not prove a page is a scan.
  • TXT and Markdown: strict UTF-8, or UTF-16 with a byte-order mark. Binary or invalid text is rejected; CRLF/CR line endings are normalized to LF.
  • Caps: 12 MiB per selected file, 300,000 processed characters, at most 400 chunks and a 45-second processing deadline. These are HiseHub resource limits, not AI-provider limits.
  • Not supported: DOCX, spreadsheets, images, OCR, password entry, batches of files, input ZIP archives and malware or prompt-injection scanning.
  • Incomplete extraction: exceeding the page/character cap or encountering failed pages is visibly marked partial. Counts and downloads cover only the extracted portion. A timeout produces no downloadable result.

If your AI still rejects the file

Use the matching guide to separate a file problem from an account or service limit. Their source-review dates are displayed on each article; platform rules can change.

Frequently asked questions

Is this PDF token counter free?

Yes. No registration, API key or paid AI request is needed. Processing uses your browser and device within the stated caps.

Can it count a scanned PDF?

It can flag pages with little or no extracted text, but it does not run OCR. A scanned PDF may yield no usable text; a zero or small text count is not proof that the document is small for a vision model.

Does splitting guarantee that an AI reads every part?

No. It creates budget-checked text parts for the selected encoding. Provider behavior, available context, request formatting, missing visuals and your workflow still matter.

Does it upload files to HiseHub or an AI service?

No upload endpoint is used. The isolated workbench reads the selected file in your browser, and downloads are created locally. The surrounding page still has ordinary visit analytics.

Method and bundled dependency review: October 3, 2026 · HiseHub 0.1.0 · PDF.js 6.3.289 · gpt-tokenizer 4.0.0