How to Convert PDF to Markdown for ChatGPT and Claude
Uploading a PDF straight into a chat window is the default, and it is usually the worst option available. Markdown costs fewer tokens, preserves the structure the model needs, and keeps the file on your machine.
LLM workflows · · 4 min read
What actually happens when you upload a PDF
When you attach a PDF to ChatGPT or Claude, the file does not reach the model as a PDF. Something on the other side extracts the text first, and the model sees the result of that extraction. You have no visibility into how it was done, no control over the settings, and no way to check what was lost.
That extraction step is the same problem described in why PDF text extraction fails: a PDF stores positioned glyphs, not paragraphs. Reading order has to be reconstructed. Two-column layouts can interleave. Running headers repeat on every page. Tables flatten into streams of numbers with no indication of which column they came from.
The model then has to work with whatever came out. When a summary confidently misreads a document, the cause is frequently not the model at all — it is that the extraction handed it a scrambled version and the model summarised that faithfully.
Why Markdown is the better input
Markdown solves the part of the problem that matters most to a language model: it makes hierarchy explicit in-band. A line beginning with ## is unambiguously a subheading. A line beginning with - is unambiguously a list item. The model does not have to infer structure from indentation or font size, because the structure is stated in characters it already understands.
This matters because these models were trained on enormous quantities of Markdown. GitHub READMEs, documentation sites, forum posts, and their own output format — Markdown is native territory. Feeding it Markdown is closer to speaking the format it thinks in than any alternative.
It is also compact. Markdown carries no styling metadata, no font tables, no positioning data. Every token you spend is a token of content, which matters directly when a long document is competing with the rest of your prompt for context.
And it survives being cut. If you need to send only part of a document, a Markdown section boundary is a clean place to slice. There is no equivalent clean boundary in extracted plain text.
The conversion, without uploading anything
Most PDF-to-Markdown services run server-side: you upload, they convert, you download. For a public whitepaper that is fine. For the documents people most often need summarised — contracts, board packs, patient records, unreleased financials — it is a disclosure you may not be permitted to make.
Our PDF to Markdown converter runs entirely in the browser. The PDF is parsed by pdf.js on your own machine, headings and lists are reconstructed locally, and the Markdown appears without any network request carrying your file. You can verify this directly: load the page, disconnect from the network, and convert anyway. It still works.
The workflow is then three steps. Convert the PDF to Markdown. Skim the output — this takes seconds and is worth it, because you will immediately see whether headings were detected and whether a table survived. Paste the Markdown into your prompt.
Reviewing the output before you paste
The skim is the step people skip, and it is the one that prevents most bad answers. Three things to look for.
Are the headings real headings? If a document's sections came through as plain text, the model loses the outline and treats a 40-page report as one undifferentiated block. Detection is font-size based, so documents using subtle typographic hierarchy sometimes need a manual pass.
Did the tables survive as tables? Tabular data is the single hardest thing to extract from a PDF, because the visual grid is drawn separately from the numbers sitting inside it. If a table came out as a run of loose values, either fix it by hand or tell the model explicitly what the columns are.
Is there repeated junk? Running headers and footers appear on every page and become noise once the page boundaries are gone. Our PDF to Text converter has an option that strips repeating lines automatically; the same instinct applies here — delete them before pasting.
When Markdown is not the right format
If a program will consume the output rather than a person or a chat window, use JSON instead. Typed lines with page numbers and font sizes give you something you can filter, chunk and cite programmatically — see chunking PDFs for RAG for what that enables.
If the document is a scan, no format helps until you run OCR. There is no text layer to convert, and every extraction tool will return an empty result.
And if you genuinely need the visual layout — a form, a diagram, a page where position carries meaning — convert the page to an image with PDF to JPG and use a model that accepts images. Text extraction discards exactly the information you need in that case.