Keep Headings and Structure When Converting a PDF
The converter infers headings from relative font size: the largest size becomes #, the next becomes ##. Here is when that works, and what to do when a document defeats it.
Direct answer
Heading detection is based on font size, not on PDF bookmarks. The converter measures the glyph height of every line, decides which size carries most of the body text, and promotes each larger size to a heading level — the largest to #, the next to ##, down to ######. It works well on documents that set headings in a visibly larger type, and it produces nothing on documents that signal headings only with bold or colour.
Open PDF to Markdown converterWhen to use this
- You are converting a structured report, whitepaper, or manual and want a real Markdown outline.
- Your output is one long wall of paragraphs and you want to know why.
- You need the outline for a wiki page or a table of contents.
Steps
- Convert the PDF with 'Detect headings' on.
- Read the output and check that the # and ## levels match the document's real hierarchy.
- If body text was wrongly promoted, turn 'Detect headings' off and re-add headings by hand.
- If headings were missed, check whether the source uses bold-only headings at body size — size is the only signal available.
- Fix any remaining level in the editable output pane before you copy.
Example
Report Title (20 pt) Introduction (14 pt) Background (12 pt) Body copy set at 10 pt across most of the document.
# Report Title ## Introduction ### Background Body copy set at 10 pt across most of the document.
Common mistakes
- Do not expect headings from a document that styles them with bold or colour at body size; the converter reads size only.
- Do not assume the level count matches your outline. Six distinct large sizes produce six levels, even when the document has three real ones.
- A large pull quote or a cover-page line in big type can be promoted to a heading. Delete it in the output pane.
- PDF bookmarks and the table of contents are not used; they are a separate structure the text layer does not expose to this tool.
FAQ
- How does it decide what body text is?
- It counts characters per font size and picks the size that covers the most characters. Only sizes more than eight percent larger than that become heading candidates, which stops a slightly taller line from being promoted.
- Why did a caption become a heading?
- Because it is set in a larger size than the body text. Size is the only signal. Remove the stray heading in the output pane, or turn detection off and add headings manually.
- Can it use the PDF's bookmarks instead?
- No. The converter works from the extracted text layer and its font sizes. Bookmarks are a separate outline structure that this tool does not read.
Related PDF to Markdown guides
How to Convert a PDF to Markdown
Drop a PDF into the browser converter. It reads the text layer, infers headings from font size, rebuilds lists, and returns Markdown you can copy or download as a .md file.
Convert a PDF to Markdown for ChatGPT, Claude, or RAG Context
Markdown is a cheaper, cleaner context format than a raw PDF dump. Convert first, strip the running headers, then paste the text into the model or your retrieval pipeline.
Why a Scanned PDF Converts to Nothing (OCR Explained)
A scanned PDF stores pictures of pages, not characters. Text extraction returns nothing because there is nothing to extract. Run OCR first, then convert.
Extracting Tables From a PDF to Markdown: What Actually Works
A PDF table is positioned text with no cell structure. This converter returns the table's text as lines, not as a Markdown pipe table. Here is the honest workaround.
Convert a PDF to Markdown for Obsidian and Other Notes Apps
Download the converted .md file straight into your vault. Headings become real outline levels, and the source PDF never leaves your machine.