PDF to Markdown

Upload a PDF file and extract its text content as Markdown. Headings are detected based on font size.

Drop a PDF file here or click to upload
Accepted formats: .pdf
PDF extraction preserves text content but may lose some formatting.
Output — Markdown

To convert a PDF to Markdown, drop the file onto the box above or click to choose it. The text of every page appears below as Markdown, ready to copy or download as a .md file. Lines in large type become headings, and pages are separated by ---. It works on PDFs that contain real text, such as exports from Word, Google Docs or LaTeX. Scanned pages need OCR first.

What does the output look like?

A two-page report with three heading sizes

In the PDF
Page 1
  Q3 Report                         24 pt
  Revenue                           16.5 pt
  Sales grew 12% on the quarter.    11 pt
  Most of it came from renewals.    11 pt
Page 2
  Costs                             16.5 pt
  Hosting fell to $4,100 a month.   11 pt
Markdown out
# Q3 Report

## Revenue

Sales grew 12% on the quarter.
Most of it came from renewals.

---

## Costs

Hosting fell to $4,100 a month.

A small table

In the PDF
Plan        Price
Free        $0
(two columns, 11 pt)
Markdown out
Plan Price
Free $0

Cells on the same line are joined with a space. There is no table detection, so rebuild it with the Table Generator.

Two paragraphs with a gap between them

In the PDF
Line one of a paragraph
continues here.

New paragraph after a gap.
(all 11 pt)
Markdown out
Line one of a paragraph
continues here.

New paragraph after a gap.

A vertical gap of more than one and a half lines starts a new paragraph. Lines inside a paragraph keep their single line breaks, which a Markdown renderer joins into one paragraph.

Why does my scanned PDF say no text was found?

A scanned page is a picture of text, and this tool only reads the text layer that PDF.js can see. It does not run OCR, so a PDF with no text on any page shows a "No text found" message instead of output. You can check quickly: if you can't select a word in your PDF viewer, there is no text to extract. Run the file through an OCR tool (OCRmyPDF, or "Recognize Text" in Acrobat) to add a text layer, then convert it here.

How does it decide what is a heading?

By the height of the text alone:

  • over 20 pt becomes #
  • over 16 pt becomes ##
  • over 14 pt becomes ###
  • 14 pt and below is body text

Bold text at body size is not detected as a heading, because the extractor doesn't see font weight. Large text that is not a heading, like a big number on a cover page or a pull quote, will get a #. Expect to fix a few headings by hand.

Why is the text in the wrong order?

Text comes out in the order it is stored inside the PDF. For most single-column documents that matches reading order. Two-column papers, sidebars and footnotes are sometimes stored in a different order, so a sidebar can land in the middle of a paragraph. If the PDF came from a Word file, converting the original with Word to Markdown keeps the structure far better.

How are headings, tables, images and other PDF content handled?

InputWhat you get
Text in large type#, ## or ### by size (over 20, 16 and 14 pt), on its own line
Bold or italic textPlain text; font style is not read
Lines on a pageOne line break each; a gap over 1.5 lines starts a new paragraph
TablesEach row becomes one line with cells separated by spaces
Bulleted and numbered listsKept as text. • bullets stay as •; lines starting with - or 1. render as lists
Multi-column layoutsStored order, which is not always reading order
Page breaks--- between pages; empty pages skipped
Headers, footers, page numbersKept as text on every page
Images, charts, diagramsDropped
HyperlinksOnly the visible text; the link target is lost
EquationsWhatever characters the PDF stores; no LaTeX
Characters like * _ # in the textNot escaped, so they may render as Markdown formatting
Scanned pages"No text found" message; no OCR. Scanned pages inside a text PDF are skipped
Password-protected filesError: "No password given"

How does this compare with MarkItDown and pdftotext?

MDConvert (this page)Microsoft MarkItDownpdftotext (Poppler)
Install neededNo, runs in the browserYes, Python packageYes, command-line tool
OutputMarkdown with headings guessed from font sizeMarkdownPlain text; -layout keeps columns lined up
Scanned PDFs (OCR)NoOptional, through Azure Document Intelligence (cloud)No
Other input formatsPDF only (other tools on this site cover Word, HTML)Yes: Word, PowerPoint, Excel, HTML and morePDF only
Many files / scriptingNoYesYes
Your file leaves your machineNoNo, unless you use the Azure optionNo

Pandoc is not in this table because it cannot read PDF files. For batch jobs, MarkItDown or pdftotext in a script will save you time. This page is for one file, quickly, with nothing to install.

Maintained by Ankit Aglawe. Last updated .

Related Tools

Need a different format? See every tool on the Markdown converter page, or go back to the MDConvert home page.

PDF to Markdown questions

What is the --- between sections of the output?
A page break. Each PDF page is converted separately and the pages are joined with a horizontal rule. Delete them if you want one continuous document. Pages with no text are skipped.
Can it open a password-protected PDF?
No. There is no password prompt, so a locked file fails with a "No password given" error. Remove the password in your PDF reader first, then convert the unlocked copy.
Are links in the PDF kept?
Only as text. If the URL is printed on the page, you get it as plain text. A link hidden behind words like "click here" is lost, because only the visible text is read.
What happens to images and charts?
They are dropped. Text that is part of a chart, such as axis labels, may still appear as loose lines if the chart was drawn as vector text rather than an image.
Is there a page or size limit?
No fixed limit. The whole file is read into your browser's memory, so very large PDFs (hundreds of pages) can be slow on a phone or an older laptop.
Is my PDF uploaded?
No. The file is opened with PDF.js, Mozilla's PDF reader, inside this page. It is not sent to a server.