PDF to Markdown — how heuristic conversion works, when it shines, and when to reach for AI
Markdown has quietly become the default container for documentation content — README files, knowledge bases, blog posts, technical specs, AI training datasets. Converting a PDF to markdown is a hugely common preprocessing step, and the right tool depends almost entirely on the structure of the source. Heuristic conversion is fast, free, and produces excellent output for well-typeset documents. AI-driven conversion is slower, costs credits, and handles cases the heuristic cannot. Here is exactly how the free heuristic works, when it gets you what you want, and when you should pay the AI cost.
How heuristic markdown extraction works
The free tool parses each text run in the PDF and records two pieces of metadata: the font size and the font weight (bold / regular). We then build a font-size histogram across the whole document. The mode (most common size) is body text — anything at that size renders as plain markdown paragraphs. Sizes above that mode become headings: ≥1.25× body becomes H3 (###), ≥1.6× becomes H2 (##), and ≥2× becomes H1 (#). Bold runs are wrapped in **markdown bold**. Italic runs become _italic_. Paragraphs are separated by line breaks longer than 1.5× the typical line-height.
This works remarkably well on documents that follow standard typesetting conventions — research papers, technical docs, well-formatted business docs, ebooks. The output is clean markdown with a recognizable structure that pastes cleanly into Notion, Obsidian, GitHub, or any markdown-aware system.
When heuristic markdown is the right answer
Cases where heuristic conversion gets you exactly what you want:
- Well-typeset reports, white papers, and research papers. These follow consistent font hierarchies that the heuristic detects accurately. Output is usually publication-ready with minor cleanup.
- Documentation PDFs going into a markdown KB. If your team's knowledge base is markdown-based (Notion, Confluence with markdown export, GitHub wiki), heuristic conversion is the fastest path to ingestion.
- AI training data preparation. RAG and fine-tuning pipelines often want markdown. The structure-aware output is more useful than plain text for chunking strategies that respect headings.
- Blog migration from PDF to web. Old PDFs to be re-published as blog posts. Markdown is the right intermediate — it carries enough structure for the blog engine to render properly without all the layout baggage of HTML.
- Quick triage of a long document. Even imperfect markdown output makes a long PDF scannable by headings, which is faster than scrolling through the PDF itself.
Three patterns that defeat heuristic conversion
The cases where the heuristic produces output you have to fix manually — or reach for AI:
- Complex tables. Tables are an inherent layout problem that markdown was not designed to express richly. The heuristic linearizes table content row-by-row, which loses column alignment. For documents with meaningful tables (financial reports, scientific papers, data sheets), use AI · Table Extract first to get the tables out as CSV, then convert the rest of the document to markdown.
- Multi-column layouts. Two-column research papers and three-column magazine layouts produce text that reads column-1-then-column-2. The heuristic outputs the columns sequentially, which is usually right, but pages with mixed layouts (one-column body with two-column callouts) can produce out-of-order output. AI conversion handles this by reading visually rather than positionally.
- Custom font hierarchies. If the source document uses non-standard typography — e.g. body text in a large display font with tiny callouts — the heuristic detects the callouts as body and the body as headings. AI conversion reads the visual hierarchy rather than the font-size hierarchy and produces correct output.
When to pay the AI cost
Specific signals that you should run AI · Rewrite (or AI · Summarize with markdown output) instead of the free heuristic:
- The source is a scan. Scanned PDFs have no text layer; the heuristic returns empty output. Run AI · OCR first to add a text layer, then convert. Or use AI · Rewrite end-to-end which folds the OCR + markdown-conversion into one step.
- Tables matter to the output. Pay for AI to preserve table structure correctly.
- Mixed-column or unusual layouts. Pay for AI to read the visual order rather than the positional order.
- You want semantic content selection. AI can extract just the abstract + introduction, or just the methodology section, on demand. The heuristic gives you everything.
Output quirks worth knowing
Three patterns in the heuristic output that catch users on the first pass:
- Hyphenated line breaks become hyphens. Some PDFs use hyphenation to break long words across lines. The heuristic preserves the hyphen, so "hyphen-ated" becomes the token "hyphen-ated" rather than "hyphenated". Most markdown renderers display this correctly, but downstream search indexers may need to handle the hyphen.
- Smart quotes survive as Unicode. Curly quotes (“”) and apostrophes (’) are preserved as their Unicode characters, not converted to straight ASCII. This is usually right; if your downstream pipeline needs ASCII, post-process with a simple regex.
- Bullet glyphs vary. PDFs use many different bullet glyphs — •, ■, -, *, →. The heuristic preserves whatever was used. Pure markdown wants "- " for list items; you may need a global replace if your renderer is strict.
Limits and compatibility
On the free web tool, PDF-to-markdown handles PDFs up to 100 MB with no page-count cap. PDFium parses each page in your browser via WebAssembly; nothing is uploaded. Output is plain UTF-8 .md with paragraphs separated by blank lines and headings preceded by the right number of # characters.
Common pairings: PDF Inspector to verify the source has a text layer before converting. AI · OCR for scans. AI · Rewrite for high-fidelity conversion when the heuristic falls short.