Tips & Tricks

How to Convert PDF to Markdown

Converting a PDF to Markdown is useful when you want to bring document content into a notes app, a static site generator, a GitHub wiki, or any other system that uses Markdown as its native format. The conversion isn't perfect โ€” PDFs and Markdown represent content very differently โ€” but for text-heavy documents, the results are often good enough to work with.

How to Convert PDF to Markdown

Why PDF to Markdown Is Trickier Than PDF to Word

PDF and Markdown sit at opposite ends of the document spectrum. PDF is a fixed-layout format that preserves exact positioning of every element. Markdown is a plain-text format that relies on simple symbols to indicate structure โ€” headings, bold, lists โ€” with no concept of page layout. Converting between them means the tool has to interpret the visual structure of a PDF and translate it into semantic Markdown symbols, which is harder than it sounds.

Multi-column layouts, footnotes, sidebars, headers, and footers all cause headaches. The conversion works cleanest on single-column documents with clear heading hierarchy and simple formatting.

WukongPDF

Try PDF to Word

No installation needed. Works directly in your browser.

Get Started โ†’

Method 1: Convert PDF to Word First, Then to Markdown

A reliable two-step approach is to convert the PDF to Word first, then convert the Word document to Markdown. Use WukongPDF's PDF to Word tool to get a .docx file, then use a tool like Pandoc or Word-to-Markdown (w2m) to convert the .docx into .md format. Pandoc is free, runs from the command line, and handles .docx-to-Markdown conversion well.

The command in Pandoc is simple: pandoc input.docx -o output.md. Pandoc maps Word's heading styles to Markdown heading levels, converts bold and italic formatting, and handles lists and tables. The output requires some cleanup but is usually a solid starting point.

Method 2: Use a Direct PDF to Markdown Tool

Several tools attempt direct PDF-to-Markdown conversion. Marker is an open-source Python tool that uses AI to interpret PDF structure and output clean Markdown, handling headings, tables, and code blocks better than older rule-based converters. MathPix Snip is another option, particularly good for academic PDFs with equations.

For simpler documents, online tools like PDF2MD offer browser-based conversion without any installation. Upload the PDF, download the .md file, and clean up the output in a text editor. The quality varies by document complexity โ€” try the output in a Markdown previewer to see how it renders before investing time in cleanup.

Handling Scanned PDFs

Scanned PDFs need OCR before any text conversion can happen. Run the file through an OCR PDF tool to create a version with an embedded text layer, then apply one of the conversion methods above. Without OCR, conversion tools see an image and produce either nothing or garbled output.

After OCR, a PDF to Word conversion followed by Pandoc tends to give better Markdown output from scanned documents than direct PDF-to-Markdown tools, because the intermediate Word step gives the converter cleaner, more structured input to work with.

What to Expect From the Output

No PDF-to-Markdown conversion produces a perfect, ready-to-use file. Expect to spend some time on cleanup: removing page headers and footers that appear mid-document, fixing heading levels that weren't detected correctly, reformatting tables that came through as misaligned text, and deleting artifacts from the conversion process.

For long documents, the time investment is still much less than retyping the content from scratch. For short documents โ€” a few pages โ€” it may be faster to paste the text directly from the PDF viewer and add Markdown formatting by hand.

WukongPDF

Try PDF to Word

No installation needed. Works directly in your browser.

Get Started โ†’