PDF to Markdown
Upload a PDF file and extract its text content as Markdown. Headings are detected based on font size.
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
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# 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
Plan Price
Free $0
(two columns, 11 pt)Plan Price
Free $0Cells 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
Line one of a paragraph
continues here.
New paragraph after a gap.
(all 11 pt)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?
| Input | What you get |
|---|---|
| Text in large type | #, ## or ### by size (over 20, 16 and 14 pt), on its own line |
| Bold or italic text | Plain text; font style is not read |
| Lines on a page | One line break each; a gap over 1.5 lines starts a new paragraph |
| Tables | Each row becomes one line with cells separated by spaces |
| Bulleted and numbered lists | Kept as text. • bullets stay as •; lines starting with - or 1. render as lists |
| Multi-column layouts | Stored order, which is not always reading order |
| Page breaks | --- between pages; empty pages skipped |
| Headers, footers, page numbers | Kept as text on every page |
| Images, charts, diagrams | Dropped |
| Hyperlinks | Only the visible text; the link target is lost |
| Equations | Whatever characters the PDF stores; no LaTeX |
| Characters like * _ # in the text | Not 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 files | Error: "No password given" |
How does this compare with MarkItDown and pdftotext?
| MDConvert (this page) | Microsoft MarkItDown | pdftotext (Poppler) | |
|---|---|---|---|
| Install needed | No, runs in the browser | Yes, Python package | Yes, command-line tool |
| Output | Markdown with headings guessed from font size | Markdown | Plain text; -layout keeps columns lined up |
| Scanned PDFs (OCR) | No | Optional, through Azure Document Intelligence (cloud) | No |
| Other input formats | PDF only (other tools on this site cover Word, HTML) | Yes: Word, PowerPoint, Excel, HTML and more | PDF only |
| Many files / scripting | No | Yes | Yes |
| Your file leaves your machine | No | No, unless you use the Azure option | No |
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.