Convert PDF to Markdown: The Complete Walkthrough
To convert a PDF to Markdown: check that the PDF has a selectable text layer, pick a converter (online, local CLI, or AI-based), run the conversion, then verify headings, tables, lists, links, and page artifacts before using the output. Below is the complete workflow, step by step, with fixes for everything that commonly breaks.
Step 1: Check your PDF's text layer
This decides everything. Open the PDF and try to select text with your cursor:
- Text selects cleanly → you have a text-layer PDF. Any converter will give reasonable results.
- Nothing selects, or selection is garbage → it's a scanned/image PDF. You need OCR first; skipping this step is the #1 cause of empty or gibberish Markdown output.
- Selects but words run together → damaged or custom encoding. Test with a small page range before committing to a full conversion.
Step 2: Pick your conversion method
Option A: Online converters (fastest)
Tools like CloudConvert, PDF.ai, or iLovePDF handle it in seconds. Best for: one-off conversions, non-sensitive documents.
Option B: Local CLI tools (best quality control)
marker, pymupdf4llm, or pandoc run on your machine. Best for: confidential documents, batch jobs, repeatable pipelines.
Option C: AI-assisted extraction
LLM-based converters handle messy layouts better but can hallucinate content that was never in the PDF. Always diff-check AI output against the source.
Step 3: The conversion itself
Upload or point your tool at the file. For a typical online flow: select file → choose Markdown as output → convert → download the .md file. For local tools it's usually a single command, e.g. pymupdf4llm document.pdf > document.md.
Step 4: Verify these five things
- Headings hierarchy — did section titles become
##/###or just bold text? - Tables — the most fragile element. Check column alignment didn't collapse.
- Lists — nested lists often flatten one level.
- Links — internal PDF links frequently disappear entirely.
- Page artifacts — running headers/footers and page numbers often leak into body text. Delete them once at the top of the document, not on every page.
Step 5: Fix what broke
If tables collapsed: re-read the original and rebuild them manually — this usually affects only a handful of tables. If headings are missing: search for visually-large lines and promote them. Our Day 1 article covers the full repair workflow.
Privacy: online vs local
Online converters upload your file to their servers. For contracts, medical records, or anything confidential, use a local tool. If you must use an online converter, check the privacy policy for retention terms — some providers state files are deleted after processing, others don't.
Quick FAQ
Can I convert a scanned PDF to Markdown?
Only with OCR. Run OCR first (or use a converter with built-in OCR), then convert.
Why is my converted Markdown full of backslashes?
The converter escaped Markdown special characters (*, _, #) that appeared literally in your PDF. This is correct behavior — strip them only if the characters weren't intentional.
Is batch conversion possible?
Yes, via CLI tools or APIs. Online converters typically limit free-tier batch sizes.
This walkthrough is part of our ongoing PDF-to-Markdown series — start with what survives conversion and what breaks, then follow along at pdf2mdtool.com for one new conversion topic each day.