OCR PDF to Markdown: The Complete Route for Scanned Documents

A scanned PDF has no text layer, so no converter can "extract" Markdown from it — OCR has to run first, then the recognized text gets structured into Markdown. The fastest working path for one file: run it through an OCR-aware converter (Marker, or an online OCR-to-Markdown service), then hand-fix the two things OCR always gets wrong: table structure and heading levels. Expect 95–99% character accuracy on clean scans, and plan for manual review of tables, footnotes, and numbers regardless of the tool.

Day 7 of our 28-day series. In the batch pipeline guide we told you to pull scanned files out of the batch — this is what you do with them next.

Step 0: Confirm your PDF actually needs OCR

Thirty seconds, three checks:

  1. Open the PDF and try to select text with the cursor. Nothing selects → it's a pure scan, OCR required.
  2. Text selects but comes out garbled or with broken characters → the file has a broken or odd-encoding text layer. OCR the pages as images anyway; the existing layer is worse than useless.
  3. Text selects cleanly → you don't need this page; go straight to the normal conversion workflow.

A size heuristic works too: a scanned page is stored as an image, so scans run 10–50× heavier per page than born-digital PDFs. A 40 MB ten-page file is almost certainly a scan.

The three OCR-to-Markdown routes

Route 1: OCR-aware converter in one step (recommended for most files)

Tools like Marker (open source, local) and several online services run OCR and Markdown structuring in a single pass — headings, lists, and even table skeletons come out mostly correct. This is the route to try first: one command or one upload, then you edit instead of building.

Route 2: OCR engine first, Markdown second (maximum control)

Run a dedicated OCR engine (Tesseract is free; ABBYY and Adobe Acrobat are paid) to produce plain text or hOCR, then structure it into Markdown yourself. Slower, but you choose the language model per document and can inspect confidence scores page by page. Worth it for historical documents, non-Latin scripts, or anything where Route 1 mangles the output.

Route 3: Online OCR converters (fastest for one-offs)

Upload, wait, download the .md. Fine for public, non-sensitive documents. The same three cautions from our single-file guide apply, plus one OCR-specific one: free online OCR tiers usually cap resolution, and low-resolution OCR is the #1 cause of garbage output. If results look bad, re-run locally at full resolution before blaming the document.

What OCR accuracy actually depends on

Source qualityExpected character accuracyMain risk
Born-digital PDF exported to image, 300 DPI99%+Almost none — this is the easy case
Clean flatbed scan, printed text, 300 DPI97–99%Occasional character swaps (rn↔m, l↔1)
Phone photo of a page, corrected perspective90–96%Word merges at page edges, shadow noise
Fax, photocopy of a photocopy, skewed scan70–90%Systematic misreads; manual review mandatory
HandwritingUnreliableDo not batch this; treat as manual transcription

Two levers move you up a row: resolution (re-scan at 300 DPI — never upscale an existing low-DPI image, it doesn't add information) and language settings (set the OCR engine's language to match the document; mixed-language documents need both languages enabled).

The two errors OCR always leaves behind

Whatever route you take, budget ten minutes per document for these:

1. Table structure (the big one)

OCR reads cells as loose text; ruling lines don't survive. Multi-column tables come out as interleaved fragments. Fix: rebuild the table by hand in Markdown pipe syntax — our table repair guide covers the five failure patterns and the fastest fixes. For tables with more than ~10 rows, retype the numbers from the scan into a spreadsheet and convert, rather than correcting OCR output line by line.

2. Heading hierarchy

OCR sees font sizes, not document structure, so `#` levels come out wrong or flat. Fix: skim the output, re-level the headings (it takes a minute), and while you're there check that list items didn't get merged into paragraphs.

Where OCR fits in the batch pipeline

In the batch workflow, scanned files are the deliberate exception: sort them into their own folder, run the OCR route on that folder separately, and apply the same empty-output/heading-density triage afterwards. OCR is CPU-hungry, so run it overnight for large folders. Never let scanned files into the main batch — they don't just fail, they fail slowly and pollute the pass-rate numbers you use to spot real problems.

Quick FAQ

Can I OCR a password-protected or encrypted PDF?

Only after removing the protection with the owner's authorization. OCR engines generally refuse encrypted files outright.

Why does OCR mangle my document's footnotes?

Footnote markers and their text blocks sit at different positions on the page, and OCR reading order mixes them into body text. Route 1 tools handle this better than Route 2 pipelines; worst case, cut footnotes and re-attach them manually.

Is there any way to keep the original page images alongside the Markdown?

Yes — Markdown image syntax pointing at per-page exports works well for audit-heavy documents: text for searchability, images for verification. Tools like Marker can emit this layout automatically.

What about scanned documents in languages other than English?

Modern engines handle major languages well when the language is set correctly — an English-only engine on a Chinese document is the classic disaster. Check the language setting before the first run, not after the third bad result.

Tomorrow in the series: the tool-selection question — a structured way to choose between converters instead of guessing. Bookmark pdf2mdtool.com and follow along.