Skip to content

PDF to Markdown

Turn a PDF into Markdown, with headings, lists and tables recovered.

Processed on your device

This tool runs entirely in your browser. Your file is never uploaded, and you can verify that in your browser's network tab. Verify it yourself: open your browser's network tab and watch. You will see one small request asking whether you have tasks left - a tool name and a hash, never the file.

What this does

This reads a PDF's text and writes it out as Markdown, working out which lines are headings, where paragraphs begin and end, and which blocks are lists or tables. A PDF stores none of that - only characters at coordinates - so the structure is inferred from geometry, except where the document has a bookmark outline, which is used instead because it is the author's own account of the structure. The result is one .md file that re-flows; it does not reproduce the original pagination or layout.

Reach for it when a document has to become editable text again: a report going into a wiki, documentation that arrived as a PDF and now needs to live in a repository beside the code, or notes you would rather search and rewrite than scroll through.

How it works

  1. Drop the PDF onto this page. The first five pages are checked for a text layer, so a scan is caught before you download an empty file.
  2. Leave Use the bookmark outline on when the document has one. A real outline is more reliable than any guess made from type size.
  3. Choose what else to detect: headings where no bookmark covers them, lists, and tables written as Markdown pipe tables.
  4. Under advanced options, add a front matter block if the file is headed for a static site, and set a page range if you only want part of the document.
  5. Press Convert to Markdown. The .md file downloads on its own.

A line becomes a heading when it is set larger than the body text around it, is short, and is followed by prose - three conditions rather than one, because any of them alone promotes running heads and figure captions by mistake. Bookmarks override the lot, which is why a document with a proper outline converts noticeably better than one without.

Paragraphs are rebuilt by asking why each line ended. A line that runs to the right edge of its column was broken by the typesetter, so the next line is joined onto it; a line that stops short ended on purpose, so a new paragraph starts. Hyphens at a line end are rejoined only when the continuation begins with a lowercase letter, which is what stops Coca- and Cola being welded into a word that was never in the document.

Tables are the least certain part of the conversion. Column boundaries are found by clustering the horizontal positions of text runs, so a real table converts cleanly while a two-column page layout can occasionally be read as one.

Extraction runs through PDF.js in a Web Worker inside your browser. What would be uploaded here is the document's text, which is usually the confidential part. Nothing about the text is sent, and the one request a run makes asks whether you have tasks left - a tool name and a hash of the bytes.

What this tool cannot do

  • Images are not extracted. The output is text and structure only; if you want the pages as pictures, PDF to image is the tool for that.
  • Layout is not preserved. Columns, text boxes and absolute positioning collapse into a single reading order, which is what Markdown is for and what makes it re-flow.

Questions people ask

How does it decide what is a heading?
If the PDF has a bookmark outline, those bookmarks become the headings and their depth becomes the heading level, so nothing is guessed. Where there is no outline, a line is promoted when it is larger than the surrounding body text, short, and followed by ordinary prose. Both sources have their own toggle.
Are tables converted?
Yes, as Markdown pipe tables, when the detector is confident enough about the columns. Positions are clustered from both edges of the text, so right-aligned number columns are found as well as left-aligned ones. If the numbers belong in a spreadsheet, PDF to CSV is the better route.
What happens to the pictures in my document?
They are left behind. Markdown references images rather than containing them, so carrying them across would mean writing a folder of files alongside the .md, and the conversion produces a single self-contained text file instead.
My PDF is a scan and nothing comes out. Why?
A scanned page is a photograph of text: there are no characters for the converter to read, so the tool stops with an explanation rather than writing an empty document. Run OCR PDF first, then convert.
Is my document uploaded to convert it?
No. The text is extracted in your browser and the Markdown is written there too, and no part of the document goes anywhere. You can check rather than take it on trust: watch the network tab while you convert, and the one request you will see is the allowance check - a tool name and a hash of the bytes, never the text.

Related tools