Skip to site navigation
PDF

PDF to Markdown

For when you want the text as Markdown and would rather not hand the document to anyone.

1Documents

Mechanism

How this works

Heading detection is the part that usually goes wrong, so it works from the modal font size on the page rather than the largest one. Every fragment is compared against the size that appears most often, which is the body text by definition, and the ratio decides whether a line becomes an h1, an h2, an h3 or a paragraph. Working from the maximum instead would let one oversized cover-page title drag ordinary paragraphs up into headings, which is exactly the failure this avoids. Once heading levels are settled, the same page geometry decides what else gets pulled out of the flow. A line only qualifies as a running header or footer after it clears three separate checks. It has to repeat across most of the document's pages and sit in the top or bottom 15% band, and its vertical position has to hold steady from page to page on top of that. Passing two of the three and failing the third leaves the line in the output, on the reasoning that eating real content is a worse failure than leaving a stray header behind. A document under three pages skips this check altogether, since a header needs enough repetitions to prove itself, and two pages cannot supply that proof.

Limits

What it cannot do

  • A document that sets its body text in several sizes will confuse the modal comparison, and some paragraphs will be promoted or demoted wrongly.
  • Multi-column layouts are read in the order pdf.js reports the fragments, which for an academic two-column paper can interleave the columns.
  • Scanned pages have no text layer at all, and this tool does not do OCR.
  • Ligatures and hyphenation carried over from the source survive into the output unchanged. A PDF that renders "fi" as one glyph, or that breaks a word across a line ending, stores exactly that shape in its text layer, and the converter copies what it finds rather than reversing the original typesetting. The result is a stray character or a hyphen sitting mid-word, easy to miss on a quick read.
Questions

Questions people actually ask

How accurate is the structure?
Headings and lists come out reliably on ordinary documents, and so do paragraph breaks and code blocks. Tables are the weak spot, because PDF stores them as positioned text carrying no row or column information, so a complex table is reconstructed imperfectly. Read those before you trust them.
Is my file uploaded?
No. Parsing happens in your browser with pdf.js and the file does not cross the network. There is no upload endpoint anywhere on this site to receive it.
Why did my two-column paper come out interleaved?
Because the text fragments are processed in the order the PDF gives them, and a two-column layout does not always store the left column before the right. Single-column documents are unaffected. For a research paper with dense two-column typesetting, expect to reorder sections by hand.