Convert a PDF to Markdown
Converting a PDF to Markdown extracts the document's text layer and rewrites it with structure restored: lines set noticeably larger than the document's median font size become # headings, bulleted and numbered lines become Markdown lists, and a --- break marks where each page ended. Layout, images, and tables are not preserved — the output is structured text. This page performs the conversion entirely in your browser; the PDF is never uploaded.
How it works
A PDF stores text as positioned runs with font and size attributes, but no semantic markup — nothing in the file says "this is a heading" or "this is a list". Markdown, by contrast, is all semantics and no positioning. The converter bridges the two statistically. It first extracts every text run with its font size, assembles runs into lines, and computes the median font size across the whole document. That median is a robust estimate of the body text size — headings are rare enough that they barely move it.
Heading inference then falls out of the ratio to that median. A line set substantially larger than the body — roughly 1.7× or more — becomes a # heading; smaller but still clear jumps become ## and ###. Using a ratio rather than absolute point sizes means the same logic works for a report set in 10 pt and a slide deck set in 20 pt. List detection is pattern-based: lines opening with a bullet glyph (•, -, *, or the common Symbol-font bullets) are rewritten as - items, and lines opening with 1., 2), and similar numbering patterns become ordered-list items. Consecutive body lines are joined into paragraphs, and a --- horizontal rule is emitted at every page boundary so the page structure remains visible in the output.
What this deliberately does not do: reproduce layout. Multi-column pages are read in extraction order, images are dropped, and tables collapse into their cell text — for those, PDF to CSV is the right tool. If you want the words with no structural markup at all, PDF to Text is simpler; if you want a browsable page rather than an editable source file, use PDF to HTML. And since everything hinges on the text layer, scanned PDFs must go through OCR first or the output will be empty.
Illustrative example: a 12-page policy document for a wiki
Illustrative scenario, not a recorded benchmark. File sizes, timings and results depend on the input and device. Try the reproducible samples.
A compliance officer needs a 12-page, 480 KB PDF policy manual in her team's wiki, which accepts Markdown. The document's median font size is 11 pt; its section titles are 24 pt and subsections 15 pt. The converter maps the 24 pt lines (ratio 2.2) to # and the 15 pt lines (ratio 1.4) to ##, catches 47 bulleted rules as - items and two numbered procedures as ordered lists, and inserts 12 --- page breaks.
The output is a 26 KB .md file: 9 top-level headings, 31 subheadings, and clean paragraphs. Cleanup took about five minutes — deleting the repeated page-footer line 12 times and removing the --- rules — versus an afternoon of copy-paste-and-reformat from a PDF viewer.
Frequently asked questions
How does the converter know which lines are headings?
It measures every line's font size and compares it to the document's median body size. Lines set noticeably larger become headings, with the largest sizes mapped to # and smaller jumps to ## or ###.
Are images and tables from the PDF kept in the Markdown?
No. The conversion works from the text layer only, so images are dropped and table cells come out as plain text lines. For table data use the PDF to CSV tool instead.
What do the --- lines in the output mean?
A --- horizontal rule is inserted where each PDF page ended, so you can still tell where page boundaries were. If you want continuous prose, delete them with a find-and-replace.
Does the converter recognize bulleted and numbered lists?
Yes. Lines starting with bullet characters such as •, -, or * become Markdown - items, and lines starting with patterns like 1. or 1) become numbered list items. The original numbering is normalized to Markdown's syntax.
Why is my converted Markdown empty or just --- lines?
The PDF is almost certainly a scan with no text layer, so there is nothing to extract. Run it through an OCR tool such as our searchable PDF tool first, then convert to Markdown.