Turn a PDF's text into Markdown

Turn a PDF into Markdown.

Open a PDF and get its text back as Markdown: wrapped lines joined, hyphenated words mended, headings ranked by font size, and bullet lists kept. Preview it, copy it, or download a .md file.

Getting clean Markdown out of a PDF

Copying text out of a PDF usually produces a mess: every line breaks where the page did, words are split by hyphens, headings look like ordinary text and bullets turn into stray symbols. PDF stores where each letter sits on the page, not the structure of the text.

This converter reads the text layer of a PDF in your browser and rebuilds the structure as Markdown: it joins wrapped lines into paragraphs, mends words hyphenated at line ends, turns larger text into headings and keeps bullet lists. Preview, copy or download the result as a .md file.

How to use it

  1. Open a PDF from your device.
  2. Choose how page breaks appear: a horizontal rule, an HTML comment, or nothing.
  3. Check the preview, especially headings and lists.
  4. Copy the Markdown or download it as a .md file.

Example: joining lines that the page broke

Input
Line 1: "This sen-"
Line 2: "tence continues"
Output
This sentence continues

A hyphen at the end of a line followed by a lowercase letter is treated as a word split by the page layout and joined back together.

How structure is recovered

The converter measures the most common font size, which is the body text. Lines in clearly larger sizes become headings, the largest becoming # and smaller ones ## and ###. Lines that start with a bullet or a number become list items. Ordinary lines are joined into paragraphs, and a larger gap between lines starts a new paragraph.

These are layout heuristics, so check the result. A genuine hyphenated word that happens to break at a line end, such as well-known, can lose its hyphen, and unusual layouts may need touching up.

What it cannot read

Scanned PDFs are pictures of pages with no text layer, so there is nothing to extract; they need optical character recognition (OCR) first. Multi-column layouts, tables and footnotes are read in the order the PDF stores them, which can mix columns or flatten tables into lines. Images and charts are not converted.

Why Markdown

Markdown keeps headings, lists and emphasis in plain text, so the result can be edited anywhere, put under version control, pasted into a wiki or fed to a language model as clean input. It is also far smaller than the original PDF.

Questions

Is my PDF uploaded?

No. The PDF is parsed in your browser with the bundled PDF.js library, so confidential documents stay on your device.

Does it work with password-protected PDFs?

Not when a password is needed to open the file. Remove the protection with the password first, in a PDF reader you trust.

How large can the PDF be?

Documents of a few hundred pages work, but very large files use a lot of memory and take longer.