PDF to Markdown: Keep the Structure, Lose the Layout Junk
A PDF is a description of where ink goes on a page. That's genuinely all it is. There's no "this is a heading" or "this is a table" baked into the file — just glyphs at coordinates, and a rendering engine that makes it look organised to you. Which is why copy-pasting a PDF into ChatGPT so often produces mush: the model receives a stream of characters with all the visual hierarchy stripped out.
Converting PDF to Markdown is about rebuilding that hierarchy. Font sizes and weights
become # and ## headings. Aligned cell grids become pipe tables. Bullet glyphs
become list items. You get a document an LLM can actually navigate instead of one it has to guess at.
Drop a file into the tool above and you'll have it in a few seconds — free, no sign-up, nothing stored.
What Actually Survives the Conversion
Worth knowing before you convert, because it shapes what you should expect on the other side:
- Headings — inferred from relative font size and weight. A report with a consistent type scale converts beautifully. A designer-led PDF where every section is styled differently is messier.
- Tables — reconstructed into Markdown pipe tables when the source has real row and column alignment. This is the single biggest reason to pick Markdown over flat text for financial reports, spec sheets, and data appendices.
- Lists — bullets and numbered items keep their nesting, so procedures and requirements lists stay readable.
- Reading order — two-column academic papers get linearised into a single flow. Usually correct, occasionally interleaved if the source has floating sidebars or pull quotes.
- What doesn't survive — page furniture. Running headers, footers, and page numbers are noise in an AI context, and stripping them is a feature, not a loss.
Markdown or Plain Text? A Straight Answer
Pick Markdown when the document's shape carries meaning. Research papers with sectioned arguments, contracts with numbered clauses, annual reports stuffed with tables, technical documentation with code blocks — in all of these, structure is information. An LLM asked "what does clause 7.3 say" needs to know clause 7.3 is a distinct unit.
Pick PDF to plain text when you only want the prose — feeding a corpus to a classifier, running keyword analysis, or piping into something that chokes on syntax characters. Markdown's pipes and hashes are pure overhead there.
The toggle at the top of this page switches between the two, and it carries whatever file you've already selected across with it — so you can convert once each way and compare without re-uploading.
Native PDFs vs Scans: Why Your Output Might Look Empty
There are two kinds of PDF wearing the same file extension, and they behave completely differently.
A native PDF — exported from Word, LaTeX, InDesign, or a browser's print dialog — contains real embedded text. Conversion is essentially lossless, and it's fast. A scanned PDF is a photograph of paper wrapped in a PDF container. There is no text in it to extract, only pixels.
Quick test: open the PDF and try to select a sentence with your cursor. If the text highlights, it's native and you'll get a clean conversion. If you get a selection box over the whole page instead, it's a scan. For scans, run OCR first — most PDF readers have "recognise text" built in — then convert. It takes an extra minute and the difference in output quality is night and day.
Why Bother, Instead of Just Uploading the PDF?
Most chat assistants accept PDF uploads now, so this is a fair question. Three reasons converting first still wins:
- You see what the model sees. When a PDF upload gives a bad answer, you can't tell whether the model reasoned poorly or the extraction mangled the source. With Markdown in front of you, that ambiguity disappears.
- You can edit before you send. Delete the 40 pages of legal boilerplate, keep the three that matter. Cheaper, faster, and noticeably more accurate answers.
- It composes. Markdown text drops straight into a system prompt, a RAG pipeline, a fine-tuning set, or a git repo. A PDF attachment doesn't.
The token counter under the output is the practical part here. A 60-page report might land around 40,000 tokens — fine for a long-context model, over budget for a smaller one. Knowing before you paste beats discovering it from an error message.
Where People Actually Use This
- Literature reviews. Convert a stack of papers, concatenate the Markdown, and ask a model to find methodological disagreements across them. Section headings survive, so you can trace any claim back to where it came from.
- Contract review. Numbered clauses stay numbered, which means you can ask about specific obligations and get answers that cite real clause numbers rather than paraphrases.
- API and vendor documentation. Plenty of enterprise SDKs still ship reference docs as PDFs. Convert them and pair the result with your GitHub repository as text so a coding assistant can see both the spec and your implementation at once.
- Financial statements. Table reconstruction is what makes this work — a model can compare figures across quarters when the rows and columns are intact.
- Lecture notes and textbooks. Convert the chapter, ask for a summary, then generate practice questions from the same source.
Getting Cleaner Output
- If the PDF has a text-based sibling — the HTML version of a paper, the DOCX the report was exported from — convert that instead. Fewer inference steps, better structure. Try Word to Markdown or HTML to Markdown.
- Split enormous PDFs before converting. A 500-page manual converts fine but won't fit any context window in one piece, and you'll get better answers from the chapter you actually care about.
- Tables that were drawn as images rather than laid out as text won't reconstruct — nothing can read them without OCR. Check the output if tables matter to you.
- Skim the first few hundred lines before pasting. Spotting a broken heading level takes ten seconds and saves you a confusing conversation with a model.
Frequently Asked Questions
How do I convert a PDF to Markdown online?
Upload the PDF above and the Markdown appears underneath, ready to copy or download as .md. Free, no sign-up, 50 MB per file. Headings come back as # levels, lists as - bullets, and tables as pipe tables, so the structure survives into whatever reads it next.
Does converting a PDF to Markdown keep the tables?
Yes, and this is the main reason to pick Markdown over flat text. A table becomes a pipe table with the row and column relationships intact, so a model asked "what was Q3 revenue" can still tell which number sits under which heading. Flatten the same table to plain text and that mapping is unrecoverable.
What happens to images inside the PDF?
Illustrations, charts and photographs are not carried into the Markdown — the output is the text layer, not an asset bundle. If the meaning of a page lives in a diagram, convert that page as an image separately and run it through image to Markdown, which reads the words rendered inside the picture.
Is there a Python library that does PDF to Markdown instead?
Several — pymupdf4llm, marker and docling are the common ones, and they are the right answer for a batch of ten thousand files in a pipeline. They also want a virtualenv, model weights and GPU time. For one document you need converted before your next message to Claude or ChatGPT, a browser tab wins.
Which is better for feeding an LLM, PDF to Markdown or PDF to text?
Markdown, when the document is structured. Models are trained on enormous amounts of Markdown and read its heading and table conventions natively, so "summarise section 4" works because section 4 is literally marked. Reach for plain text only when you want the syntax characters gone — chunking for embeddings, mostly.
Will the page order and reading flow be preserved?
Single-column documents come through in reading order reliably. Two-column academic layouts usually linearise correctly, but pull quotes, floating sidebars and footnote blocks occasionally land mid-paragraph because they sit mid-page in the source coordinates. Worth a skim of the output before you trust it for anything precise.
The Rest of the Toolkit
PDF is one of thirteen formats handled here. File2Txt takes any of them if you'd rather not pick a specific page, or go straight to Excel to Markdown for spreadsheets, PowerPoint to Markdown for decks, or EPUB to Markdown for e-books.
Working with code or the web instead? Convert a repo with the GitHub to text converter, a GitLab project, or a folder on your machine. For web pages, Web2Txt scrapes a URL into Markdown. There's also a longer write-up on preparing documents for LLMs if you want the general version of this argument.
Repo2Txt is built and maintained by v12hero, an independent developer building privacy-first native and web apps.