How to Convert PDF to Markdown
Four proven methods — from a zero-setup online converter to fully programmatic pipelines — and when to use each.
Short answer: upload your PDF to the free PDF to Markdown converter — it extracts the text in your browser (with OCR for scanned PDFs) and gives you editable Markdown to copy or download. The other methods below are better for batch jobs and custom pipelines.
1. Free online converter (fastest)
Upload the PDF to a browser-based converter and copy the Markdown out. The MarkdownTools PDF to Markdown converter extracts headings, paragraphs, and lists locally in your browser — the file is never uploaded to a server — and includes an OCR mode for scanned PDFs. Best for one-off conversions and confidential documents.
Best for: One-off conversions, scanned PDFs, private documents
2. Microsoft MarkItDown (command line)
MarkItDown is Microsoft's open-source Python tool for converting documents to Markdown, built with LLM pipelines in mind. Install it with "pip install markitdown" and run "markitdown document.pdf > document.md". Good structure preservation, but requires Python and gives you less control over cleanup.
Best for: Batch conversions and RAG/LLM ingestion pipelines
3. Python libraries (programmatic)
For custom pipelines, libraries like pymupdf4llm ("pip install pymupdf4llm") convert PDFs to Markdown in a few lines of code and let you tune how tables, images, and page breaks are handled. This is the most flexible option, and the most work.
Best for: Custom document pipelines with special requirements
4. Copy, paste, and clean up (no tools)
For short documents, select the text in your PDF reader, paste it into a Markdown editor, and re-apply the formatting by hand. Tedious for anything long, but zero setup and full control. A Markdown editor with live preview makes the cleanup much faster.
Best for: Short documents and precise control over the result
Which method should you pick?
If you convert PDFs occasionally, use the online converter and move on — there is nothing to install and your file stays on your device. If you are feeding documents into an AI system regularly, script it with MarkItDown or pymupdf4llm so the conversion is repeatable. And whichever method you choose, budget a minute to skim the output: PDF is a print format, so headings, tables, and multi-column layouts sometimes need a quick touch-up in a Markdown editor before publishing.
Frequently Asked Questions
What is the best way to convert a PDF to Markdown?
For most people, a free browser-based converter is the fastest: no installation, and good tools process the file locally so it stays private. For batch jobs or LLM pipelines, command-line tools like Microsoft MarkItDown or the pymupdf4llm Python library are better suited.
Can I convert a scanned PDF to Markdown?
Yes, but it requires OCR because scanned pages are images with no text layer. The MarkdownTools converter includes a built-in OCR mode that reads scanned pages in your browser; command-line workflows typically pair Tesseract OCR with a Markdown formatter.
Why convert PDFs to Markdown for AI tools?
Markdown keeps document structure (headings, lists, emphasis) in a compact, token-efficient format that language models handle well. RAG pipelines also chunk more accurately on Markdown headings than on raw PDF text extraction.
Does converting a PDF to Markdown preserve tables and images?
Partially. Simple tables usually survive; complex multi-column layouts often need manual cleanup. Images are not embedded in Markdown itself — they need to be extracted separately and referenced with image syntax.