About the PDF to Markdown
Convert PDF to Markdown: the text of a PDF comes out as a .md file with headings marked by # and ##, broken lines joined back into whole paragraphs, and a rule between pages. Use it when you're moving a PDF guide, manual or report into a README, a wiki, a notes app such as Obsidian, or a chat with an AI assistant that reads Markdown well.
Your browser does the conversion, so the PDF stays on your device. Copy the Markdown straight from the result box, or download it as a .md file named after your PDF.
How headings and paragraphs are detected
A PDF stores small pieces of text with positions, not headings or paragraphs. The tool reads those pieces with Mozilla's pdf.js library, joins the ones at the same height into lines, and takes the median character size as the body text size: half of all the characters in the document are set at that size or smaller, so long runs of paragraph text outweigh a few large headings. Every line is then measured against that size.
ratio = line text height ÷ body text height ratio ≥ 1.6 → # Heading ratio ≥ 1.25 and under 120 characters → ## Heading anything smaller → paragraph text drop from the line above > 1.8 × the → new paragraph height of that line new page → --- (horizontal rule)
Lines inside one paragraph are joined with spaces, so text that wrapped at the edge of the PDF page becomes one flowing paragraph that reflows on any screen. Bold, italics, links, lists, tables and images aren't turned into Markdown syntax: their text comes through as ordinary paragraphs.
Assumptions and limits
- Scanned pages are pictures with no text layer. If the PDF is a scan you'll see 'No selectable text was found'; run it through OCR PDF first, then convert the result.
- Two-column layouts are read straight across the page, so a line from the left column can be joined to the line beside it on the right.
- Headings are judged by size only. A large pull quote can become a heading, and a heading set in bold at body size stays a normal paragraph.
- List items at normal line spacing are joined into one paragraph, with bullet characters such as • kept as typed rather than turned into Markdown list items. Running headers, footers and page numbers appear wherever they sit on each page.
- Characters that have a meaning in Markdown, such as * _ and #, aren't escaped, so a paragraph that starts with one may display differently in a Markdown viewer.
Worked examples
A report with a title and section heads
A report has an 11 pt body, a 24 pt title and 15 pt section headings. The title becomes a level-one heading, the sections become level-two headings, and a 12 pt caption stays in the text.
Title 24 pt 24 ÷ 11 = 2.18 → # Annual Report 2025 Section 15 pt 15 ÷ 11 = 1.36 → ## Results Caption 12 pt 12 ÷ 11 = 1.09 → paragraph
A 3-page handout for a wiki
The Markdown has two --- lines, one at each page change, so you can see where page 2 and page 3 began. Delete them if the wiki page should read as one continuous document.
What each part of a PDF becomes in Markdown
Sizes are compared with the body text size of the whole document.
| In the PDF | In the Markdown file |
|---|---|
| Line at least 1.6 times the body size | # Level-one heading |
| Line 1.25 to 1.6 times the body size, under 120 characters | ## Level-two heading |
| Body text wrapped across several lines | One paragraph, lines joined with spaces |
| Larger gap between lines | Blank line (start of a new paragraph) |
| Start of a new page | --- horizontal rule |
| Bold, italics and links | Plain text, no ** or [ ] syntax |
| Tables and bulleted lists | Plain text lines or paragraphs |
| Images and drawings | Left out |
How to use the PDF to Markdown
- Choose the PDF. Pick a PDF that has selectable text; scans need OCR PDF first.
- Convert to Markdown. Headings are detected from text size and paragraphs are rebuilt automatically.
- Copy or download. Use Copy on the Markdown box, or download the .md file.
Frequently asked questions
How do I convert a PDF to an MD file?
Choose the PDF, press Convert to Markdown and download the result. The file keeps your PDF's name with a .md ending and opens in any text editor, in GitHub, and in Markdown note apps such as Obsidian.
Are PDF tables converted to Markdown tables?
No. The cells of each row are read straight across as one line of text, without | separators, and rows that sit close together run on into a single paragraph. For tables, PDF to Excel gives you real rows and columns, and you can rebuild the few tables you need in Markdown by hand.
Why are some of my headings missing?
Most likely they're printed at body text size. Headings are found by size: a line needs to be at least 1.25 times the body text size, and under 120 characters, to count. Headings printed in bold at the same size as the text can't be told apart from paragraphs, so add the # marks by hand.
Can I convert a scanned PDF to Markdown?
Not directly, because a scan holds pictures of the letters rather than text. Run it through OCR PDF to add a text layer, then open the new PDF here. Check the headings afterwards, because the OCR text layer may not keep the size differences of the printed page.
Is my PDF uploaded?
No. The PDF is read and the Markdown is built by your browser, on your own computer or phone. None of its text reaches our server, so internal documents and drafts are fine to convert.
This tool runs entirely in your browser. What you enter or upload stays on your device and is never sent to our servers.