PDF to Markdown

Convert PDF to Markdown: the text of a PDF as an .md file with headings and bullets.

Your files stay on this device. Nothing is uploaded. How to check

Advertisement

How to use PDF to Markdown

1. Drop your PDF on the upload box or click Choose Files. Use Remove File if you picked the wrong one.
2. Click Convert PDF to Markdown. Each page's text is grouped into lines; short first lines and short all-caps lines become ## headings, lines starting with a bullet, hyphen or asterisk become list items, and the rest become paragraphs.
3. Click Download File to save the .md, or use Copy Markdown to take it from the editable box under the result.

Key features of PDF to Markdown

📑 Headings and lists

The file starts with a level-one heading taken from the file name. Short first lines and short all-caps lines become level-two headings, and bullet lines become a Markdown list.

📄 Page markers

In a multi-page PDF each page is separated by a horizontal rule and an italic Page N line, so you can see where the original page breaks were.

🖥️ Nothing is uploaded

The PDF is read and the Markdown is built by JavaScript in your browser. Nothing is sent to a server, and there is no account or watermark.

About PDF to Markdown

PDF to Markdown reads each page with pdf.js and groups text runs into lines by their vertical position. The first line on a page, if under 50 characters, and any line under 35 characters written in capitals become ## headings. Lines beginning with a bullet, a hyphen or an asterisk become list items with the marker normalised to a hyphen. Everything else is written as a paragraph, and the result is offered as a .md download and in an editable box with a copy button.

It suits getting a PDF's text into a README, a wiki, a static site or a notes app that reads Markdown. Bold and italic text, links, images and tables are not detected, and a table comes out as plain lines. The heading rule is simple, so a short first line such as a date may become a heading. A scanned PDF has no text layer and yields only the title and page markers; run it through OCR PDF first.

When to use PDF to Markdown

A vendor's release notes or a changelog arrives as a PDF and you want it in an issue or a pull request that renders Markdown. Convert, copy from the box, and paste; the ## headings and - bullets render as they should, and the page markers show where each PDF page began.

You keep requirements or a checklist in a PDF and want it as a task list. Bullet lines come out as - items, so add [ ] after each hyphen in the box and the list becomes checkboxes.

You want to hand a document to a chat assistant or paste it into a prompt. The output starts with a level-one heading taken from the file name; change it to the document's real title in the box.

When the headings depend on font size rather than position, PDF to Word detects them by size and joins wrapped lines into paragraphs, which this tool does not. If you need a web page rather than Markdown, PDF to HTML uses the same line grouping and writes h2 and p tags. A scan gives only the title and page markers until it has been through OCR PDF.

Tips and troubleshooting

  • Failed to convert PDF to Markdown: No password given means the PDF needs a password to open. Remove it first; copy restrictions do not stop the conversion.
  • Each PDF line becomes its own paragraph, separated by a blank line. Wrapped lines are not joined, so a five-line paragraph becomes five short ones; join them in the box or use PDF to Word.
  • A normal line straight after a bullet is written on the next line with no blank line between, and many renderers then show it as part of the bullet. Insert a blank line after the list.
  • Any line starting with a hyphen, an asterisk or a bullet character is treated as a list item, including a negative number such as -5 and a line that begins with a dash. Numbered lists (1., 2.) are not detected and stay as paragraphs.
  • Short lines with no lower-case letters count as capitals and become ## headings when under 35 characters, and the first line of every page becomes one when under 50 characters, so a running header repeats as a heading on each page.
  • Markdown characters in the text are not escaped: a line beginning with # becomes a heading, paired asterisks or underscores become emphasis, and a line of hyphens becomes a rule. Backslash-escape them in the box if they are meant literally.
  • Preview Document loads the .md into a frame; the box under the result is the surer check. Copy Markdown copies the box including edits; Download File saves the original, named after your PDF with an .md extension.
  • If the text is going onto a web page and you want markup you can open in a browser, PDF to HTML writes the same text layer as a standalone HTML file.
  • If the output holds only a title and page markers, the PDF is a scan. The guide how to make a scanned PDF searchable explains how to add a text layer first.

How PDF to Markdown works in your browser

The file is read into memory and parsed by pdf.js in a worker loaded from cdnjs.cloudflare.com. For each page the script fetches the text runs, rounds their vertical positions and starts a new line when the position moves by more than 6 points. The output string begins with a # heading made from the file name; then, for each page of a multi-page file, a horizontal rule and an italic Page N line; then each line as a ## heading, a - item or a paragraph according to the rules above.

The finished string becomes a Blob of type text/markdown and is passed to showResult for the card, after which the script appends a textarea with the same text and a Copy Markdown button that writes the box's contents with the clipboard API and reads Copied for two seconds. Download File saves the Blob through a temporary object URL. The PDF bytes and the Markdown stay in the tab; the page never sends them anywhere.

Frequently asked questions

Does it keep bold, italic, links and tables?

No. Only headings, bullet lists and paragraphs are produced. Bold and italic runs come out as plain text, links lose their targets, and a table becomes one line per row.

How are headings detected?

By position and length, not font size. The first line on each page becomes a heading if it is under 50 characters, and any line under 35 characters written entirely in capitals is treated as one. Check the result, since a date or a short label can be promoted by mistake.

Can it convert a scanned PDF?

Not on its own. A scan has no text layer, so the output holds only the title and page markers. Run the file through OCR PDF first, then convert the searchable PDF.

Which Markdown dialect is the output?

Only the common core: # and ## headings, - list items, *italic* page markers and --- rules. Every dialect reads those. No tables, code blocks, footnotes or task lists are produced.

Can I convert only some pages?

No. Every page is converted, separated by a rule and a Page N line. Run the file through Extract Pages first to keep only the pages you need, then convert that.

Does it work on a phone?

Yes. Choose the PDF, tap Convert PDF to Markdown, and copy from the box or download the .md. The box shows eight lines at a time; scroll inside it to read more.

Last reviewed