PDF to Markdown Converter
Turn a PDF into Markdown. A PDF has no headings, only text drawn at different sizes, so the structure is worked out from those sizes and the gaps between lines. Headings, paragraphs and lists come back as Markdown you can paste anywhere. Nothing is uploaded.
- Nothing uploaded
- Works with no signal
- No sign up
- Reads the text layer
Nothing loaded yet.
The text
Load a PDF to see what it contains.
This reads what is actually in the file. A scanned document contains pictures of letters rather than letters, so there is nothing to extract until it has been through optical character recognition.
Your PDF never leaves this device.The file is opened and read by your browser, the text is extracted here in the page, and any download comes from your own machine. Nothing is sent to a server, so nothing is stored on one. Open the network tab in your browser tools and load a document: there is no upload request to see.
Reading order rebuilt from the page
A PDF stores runs of text in whatever order they were written, which is often not the order you read them. Every run is placed by its position instead.
How to use this tool
Drop a PDF on the box at the top. The Markdown appears immediately, along with a count of the headings, paragraphs and list items that were found, so you can see whether the structure was read the way you expected.
Copy it straight out, or download it as a file.
A PDF has no headings
This is the thing to understand before trusting any tool that claims to do this, including this one.
When you write a heading in a word processor, the document records that it is a heading. When that document becomes a PDF, almost all of that is thrown away. What remains is a set of instructions to draw particular characters at particular positions in a particular size. The idea of a heading does not survive.
So the structure has to be inferred, and the only real clue is size. Text set noticeably larger than the body is almost certainly a heading, and how much larger suggests how important it was.
Working out which size is the body
The body size is whichever size most of the text uses. That sounds obvious and the detail matters: it is measured by how many characters each size covers, not by how many separate pieces of text there are.
A page might hold six short headings and two long paragraphs. Counting pieces would decide the headings were the body and the prose was something unusual. Counting characters gets it right, because a paragraph contains far more letters than a title does.

Heading levels are then worked out as a ratio to that body size rather than from absolute numbers. A document set in nine point and one set in twelve point produce the same structure, which is what you want.
Where paragraphs begin
Lines that belong together are joined back into a paragraph, and a new one starts where the vertical gap grows well beyond the usual line spacing. That spacing is measured from the document itself rather than assumed.
There is a trap in that measurement worth mentioning, because it was a real bug here before testing found it. Taking the middle value of all the gaps sounds right, but on a short extract with only two gaps, the middle value can be the paragraph break itself. The threshold then ends up larger than any gap in the document and nothing ever splits, so the whole thing comes back as one run on paragraph. It now takes the lower of the middle values instead.
A worked check you can repeat
Take a page with a twenty four point title, sixteen point section headings and eleven point body text. The title becomes a first level heading, the sections become second level, and the prose becomes paragraphs with their wrapped lines joined back together.
Now open the same document scaled to another size. Because the levels are ratios, the structure comes out identically.
The conversion was checked against an independent implementation before publishing: thirty seven hand written cases covering body size detection, heading levels at every boundary, bullets and numbered lists, characters that need escaping so the Markdown says what the PDF said, gaps that should split a paragraph and page breaks that always do. Then fifty thousand generated cases across thirty thousand documents, producing nearly sixty thousand headings and sixty eight thousand list items, confirming that no line of text is ever lost and that escaping always round trips.
Two real bugs came out of that. A heading at exactly one and a tenth times the body size computed to a fraction under the threshold and was missed, so the comparisons now allow for floating point noise. And the paragraph splitting problem described above.
Mistakes that catch people out
Expecting tables to survive. They will not. A PDF has no rows or columns, only text at positions.
Using a document whose headings are bold rather than larger. There is nothing to detect, and everything arrives as paragraphs.
Feeding in a scan. A picture of text contains no text. Run it through optical recognition first.
Expecting images. Only the text layer is read.
Assuming a password protected file will open. It will not. Remove the protection first, in software that has the password.
Common questions
Is my PDF uploaded anywhere?
No. The file is read by your browser, the Markdown is produced here on the page, and any download comes from your machine. Nothing crosses the network.
How does it know what is a heading?
By size. A PDF records no headings at all, only text drawn at particular sizes, so anything set noticeably larger than the body is treated as one.
Why are the heading levels sometimes wrong?
Because size is the only clue available. A document that uses bold rather than a larger size for its headings has nothing to detect, and one with many sizes may produce more levels than you expected.
Will tables come out properly?
No. A PDF stores a table as text at positions, with no notion of rows or columns, so it arrives as ordinary lines. Use the PDF to CSV tool for tabular data.
Are images included?
No. Only text is converted. Anything drawn as a picture is not part of the text layer and does not appear.
Why did a scanned document produce nothing?
Because a scan is a picture of text rather than text. There is nothing in the file to read, and the tool says so rather than returning an empty document.
Related PDF tools and reference
Reference: CommonMark, the Markdown specification the output follows.
