Markdown has become the default format for personal knowledge bases, team wikis, documentation sites and version-controlled notes. PDFs, meanwhile, are how a lot of source material arrives: a vendor's integration guide, a research paper, an internal policy, lecture handouts. Getting the text from one into the other by copy and paste means fixing every line break and re-creating every heading by hand.
This guide explains how PDF-to-Markdown conversion works, which parts of a document survive and which do not, how to convert in your browser with control over headings and headers, and how to clean the result up efficiently.
Why Markdown is a good target for PDF content
Markdown captures structure rather than appearance. A heading is a heading, a list is a list, a paragraph is a paragraph. That makes it a natural fit for PDF content you want to reuse:
- It is plain text, so it works with search, version control and diff tools.
- It can be pasted into most wikis, documentation generators and note apps.
- It is easy to edit, restructure and link to other notes.
The challenge is that a PDF does not store structure either. It stores positioned text in various fonts and sizes. A converter has to infer the structure from visual clues.
How structure is detected
A PDF-to-Markdown converter typically:
- Extracts lines of text from each page, ordered from top to bottom.
- Joins lines into paragraphs when they are close together and similarly formatted.
- Finds the body text size, the font size used for most of the text.
- Marks larger text as headings. Text noticeably bigger than the body size, short and without a trailing full stop, becomes
#,##or###depending on how much bigger it is. - Recognises list items that start with bullet characters (•, ▪, –, and similar) or numbers followed by a full stop or bracket.
- Removes page furniture, such as a report title or "Page 3 of 10" repeated at the top or bottom of many pages.
It also escapes characters that Markdown would otherwise interpret. If the PDF contains a literal asterisk or underscore, it is preserved as text rather than turning the next words into italics.
What this approach cannot recover: tables (they arrive as lines of text), images, footnote links, bold and italic within paragraphs, and multi-column reading order in complex layouts.
Convert PDF to Markdown in your browser
Our PDF to Markdown tool performs these steps locally in your browser.
- Open PDF to Markdown and drop in your PDF.
- Review the three switches:
- Detect headings by font size turns large text into
#headings. Switch it off if a document uses big text for decoration and you get too many false headings. - Remove repeated headers & footers strips lines that repeat at the top or bottom of many pages, ignoring changing page numbers. It applies to documents of three or more pages.
- Mark page breaks (---) inserts a horizontal rule between pages. Useful when you need to cite page numbers, but usually left off for notes.
- Detect headings by font size turns large text into
- Enter a Pages range such as
2-5, or leave it empty for everything. - Click Convert to Markdown.
- Switch between the Markdown tab (editable source) and the Preview tab (rendered view) to check the structure.
- Copy the result, or click Download .md.
If some pages contain no text, the tool lists them. Those are scanned images and need OCR before they can become Markdown.
Other approaches
Can pandoc convert PDF to Markdown?
People often expect pandoc to do this, but pandoc does not read PDF as an input format. A common workaround is to extract text first (for example with pdftotext) and then structure it by hand, or to convert the PDF to a Word document and run pandoc on the .docx:
pandoc guide.docx -t gfm -o guide.md
That route can preserve bold, italics and some tables if the Word conversion captured them, at the cost of an extra step.
Plain text first
For documents with little structure, PDF to Text and a few minutes of manual formatting may be all you need.
HTML as an intermediate
If you need to keep more of the layout, PDF to HTML in flowing mode and then HTML to Markdown is another route, although the result is similar for most text documents.
Cleaning up the Markdown
Check heading levels
Heading levels are based on size ratios. Make sure there is a single top-level heading and adjust levels where the original used unusual sizes.
Rebuild important tables
Tables arrive as consecutive lines. For small tables, rebuilding them with the Markdown Table Generator is quick. For large ones, extract them with PDF to Excel and convert from there.
Re-add emphasis and links
Bold, italics and hyperlinks are not carried over. Add back the ones that matter.
Watch hyphenation
Words hyphenated at the end of printed lines may keep their hyphen when lines are joined. A quick search for "- " patterns catches most of them.
Publishing as a PDF again
After editing, you can produce a fresh, cleanly formatted PDF with Markdown to PDF.
Frequently asked questions
Does PDF to Markdown keep tables?
Not as Markdown tables. Table contents come through as lines of text. Use a table extraction tool for tabular data.
Why did some large text not become a heading?
Headings must be short and not end with a full stop, colon or comma. Large text that looks like a sentence is kept as a paragraph.
Can I import the result into Obsidian or a wiki?
Yes. The output is standard Markdown, so you can paste it or save the .md file into your vault or wiki.
What does removing repeated headers and footers do?
It deletes short lines that repeat at the top or bottom of at least half the pages, such as a document title or page numbers.
Is the PDF processed privately?
Yes. The conversion runs in your browser and the file is not uploaded.