Why give a model Markdown instead of a PDF
When you attach a PDF to a chat, the app extracts its text for you, and you don't see what the model actually got. Converting it yourself first has three advantages:
- You can see the text. Broken tables, scrambled columns and pages with no text show up before the model gets confused by them, not after.
- Structure survives. Headings, lists and tables are kept as Markdown, which models read well, instead of a flat run of lines.
- It costs fewer tokens. Page numbers, running headers, hyphenated line breaks and layout padding are removed, so more of the context window goes to content.
This page opens with settings tuned for that: images left out, a <!-- Page N --> comment where each page starts so a model can cite pages, and image lines dropped.
Token counts you can trust
The count above the Markdown is the exact number of tokens in what you'll copy or download, front matter and page markers included. It's computed with o200k_base, the encoding used by GPT-4o and later OpenAI models. Other models, Claude among them, use their own tokenizers, so for them treat the number as a close estimate rather than an exact one.
Every switch under Trim for LLMs shows how many tokens it saves on your file before you flip it:
| Switch | What it does |
|---|---|
| Drop link addresses | Keeps the link text, removes the URL |
| Drop bold and italic | Removes the ** and * markers |
| Drop image lines | No image placeholders or links |
| Plain text for HTML tags | <sup>, <sub> and <br> become plain text |
| Normalize characters | Ligatures such as fi become fi; odd spaces become plain spaces |
| Compact tables | Drops empty columns and cell padding |
The switches re-run in milliseconds, since the PDF isn't read again.
Chunks for RAG
Retrieval needs the document in pieces small enough to embed, and pieces that make sense on their own. The Chunks tab splits the Markdown for you:
- At headings first. A chunk never starts in the middle of a section if it can help it, so each one covers one topic.
- Under a token budget you choose, from 256 to 8,192 tokens. A section larger than the budget is split between sentences, and a large table between rows, with the header row repeated.
- With its heading path. Each chunk knows the headings above it, such as
Methods › Data collection, and can start with them, so a retrieved chunk still says where it came from. - With its pages, so an answer can point back to page 12 of the original.
Download JSONL gives one JSON object per line:
{
"id": "report.pdf#3",
"source": "report.pdf",
"chunk": 3,
"headings": ["Methods", "Data collection"],
"page_start": 4,
"page_end": 5,
"tokens": 812,
"text": "..."
}
A few lines of code load it into whatever vector store you use.
A workflow that works
- Drop the PDF and look at Pages to check first. Fix or OCR any page that came out wrong.
- Turn on the trims whose savings are worth it; leave links on if you want the model to cite sources.
- For a chat, copy the Markdown and paste it in. For a pipeline, take the JSONL chunks.
Everything happens in your browser, which matters here: documents people feed to models are often internal reports, contracts or research that shouldn't be uploaded to yet another service.
Frequently asked questions
Is Markdown really better than plain text for an LLM?
For documents with structure, it usually helps: headings tell the model how sections nest, and tables keep each number next to its labels. For a single page of prose, the difference is small. The converter lets you keep or drop that structure with the switches.
What chunk size should I use?
Start with 512 or 1,024 tokens for question answering over documents. Smaller chunks match narrow questions more precisely; larger ones keep more context together. The summary under the Chunks tab shows the count and the largest chunk, so you can see the effect at once.
Does it count tokens on my device?
Yes. The tokenizer runs in the tab like the rest of the converter. Nothing is sent to OpenAI or anyone else to count it.
Can I process many PDFs for a dataset?
You can drop up to 20 at a time and download them all as one .zip. For thousands of files, a script is the better tool; see PDF to Markdown in Python.