How to Get a PDF Ready for ChatGPT: Clean Text, Chunks, Token Counts

Knowledge Builder Pro TeamUpdated 5 min read

Update Sep 2026: OpenAI plans to retire custom GPTs on Dec 11, 2026 and move them to plugins. The same file prep applies to plugins and Projects.

Introduction

A PDF is built for printing, not for reading as text. Before you upload one to ChatGPT (file chat, Projects, or plugins) or a Claude Project, it pays to turn it into something cleaner: plain text with the page furniture removed, split into sensibly sized pieces, with a clear idea of how big each piece is.

This guide walks through that prep step by step. Every step is something you can check yourself before you upload anything.

Step 1: Check that the PDF has a real text layer

Open the PDF in Preview or Acrobat and try to select a paragraph. If you can highlight individual words, the PDF has a text layer and you can extract it. If the selection grabs the page as one block, it is a scanned image with no text in it.

Scanned PDFs need OCR first. Adobe Acrobat's Scan & OCR tool works, and Tesseract is free from the command line. Knowledge Builder Pro does not run OCR, so a scanned page has no text for it to extract either.

Step 2: Strip headers, footers, and page numbers

PDFs exported from Word, InDesign, or a browser usually repeat the same running header and footer on every page. Flatten that to text and a sentence like "The 2025 rate table shows $0.18/kWh for industrial usage" turns into "The 2025 rate table | Confidential — Do Not Distribute | page 47 | Q3 Report | shows $0.18/kWh for industrial usage."

That repeated text is noise. Remove it so what is left is the document itself. On a Mac, pdftotext -layout file.pdf output.txt gives you a text file, and a quick Python pass drops the lines that repeat on every page:

from collections import Counter
 
lines = open("output.txt").read().splitlines()
freq = Counter(lines)
# drop lines that repeat 3+ times — those are headers, footers, and page numbers
clean = [l for l in lines if freq[l] < 3 and l.strip()]
open("clean.txt", "w").write("\n".join(clean))

Step 3: Watch for multi-column layouts

Academic papers, legal briefs, and magazine-style PDFs often use two or three columns. Simple extractors read straight across the page, which interleaves the columns into scrambled sentences. Skim the extracted text: if sentences jump between topics mid-line, re-extract column by column or fix those passages by hand.

Step 4: Save it as clean text or Markdown

Plain text or Markdown keeps the words and drops the display layer. Headings become ## Section lines and lists become - item entries, so the structure of the document survives as text you can read and edit. If you want Markdown specifically, the free PDF to Markdown tool converts in your browser.

Step 5: Split it into chunks on real boundaries

One 200-page file is hard to work with. Split it into focused pieces instead:

  • Split on headings first, so each chunk covers one section.
  • Sub-split anything very long, and give neighbouring chunks a little overlap so an idea that crosses a boundary appears in both.
  • Start each chunk with its section title so you can tell at a glance what it covers.

The free Text Splitter does this in your browser by tokens, words, or characters, with optional overlap and part labels.

Step 6: Know the size before you upload

ChatGPT caps each uploaded file at 512MB, and models work within a context window measured in tokens. Count before you upload so you know what you are handing over. The free Token Counter shows the token count for any text in your browser.

Step 7: Add a short glossary if you use jargon

If the document uses domain vocabulary — medical codes, financial terms, internal project names — put a plain-language glossary at the top: "ARR = annual recurring revenue. COGS = cost of goods sold. Project Apollo = the 2024 platform migration." It makes the file easier for anyone (or anything) to read, and it costs a few lines.

How to check your work

Before you upload, open the output and skim it:

  1. Does the text read as sentences, not scrambled columns?
  2. Are the headers, footers, and page numbers gone?
  3. Does each chunk start with a clear section title?
  4. Do you know how many tokens each chunk is?

If all four are yes, the file is ready.

Doing it in one step

If you would rather not script it, the free knowledge base builder does steps 2, 5, and 6 for one file: it strips page furniture, normalises the formatting, splits the text into chunks with overlap, and labels every chunk with its source file, key terms, and an approximate token count. You get plain .txt files (a zip when there are several) to drop into ChatGPT or a Claude Project. One file up to 5MB is free with no account, nothing is stored, and packs start at $9 once if you have more files.

Stop wrestling with messy documents

Knowledge Builder Pro converts your PDFs, DOCX, and other files into clean, chunked knowledge base files optimized for ChatGPT, Claude, and RAG pipelines.