How to Convert PDF to Markdown
5 methods — from drag-and-drop to command line
Why Convert PDF to Markdown?
PDFs are great for final documents, but terrible for editing, version control, and collaboration. Converting a PDF to Markdown gives you:
- A plain-text file you can edit in any text editor
- Content that works with Git for version tracking
- A format that renders beautifully on GitHub, GitLab, and documentation sites
- Text you can search, copy, and restructure without fighting PDF formatting
Common scenarios: you received a spec as a PDF and need it in your project docs. A client sent requirements in PDF and you want them in your wiki. You’re migrating legacy documentation to a modern static site.
Method 1: Marker (Best Quality, Free)
Marker is an open-source tool that uses AI to convert PDFs to Markdown with high accuracy — including tables, images, and complex layouts.
- Install:
pip install marker-pdf - Convert a single file:
marker_single input.pdf output/ - Find the result in the output directory as a
.mdfile
Marker handles multi-column layouts, embedded images, and tables better than most alternatives. It runs locally — your documents never leave your machine.
Best for: complex PDFs with tables, images, and mixed layouts.
Method 2: Pandoc (Fast, Command Line)
Pandoc is the Swiss army knife of document conversion. It can convert PDF to Markdown, but the output quality depends on the PDF structure.
- Install Pandoc:
brew install pandoc - Convert:
pandoc input.pdf -t markdown -o output.md - Review and clean up the output
Pandoc works best with text-heavy PDFs. It struggles with complex tables, multi-column layouts, and scanned documents. For simple documents, it’s fast and reliable.
Best for: text-heavy PDFs without complex formatting.
Method 3: AI-Assisted Conversion (Claude, ChatGPT)
Modern AI tools can convert PDF content to well-structured Markdown. This works especially well for documents where you need clean, reorganized output rather than a 1:1 copy.
- Open Claude, ChatGPT, or another AI assistant
- Upload or paste the PDF content
- Ask: “Convert this to well-structured Markdown”
- Copy the output into a
.mdfile - Review and verify the content
AI conversion is excellent at understanding document structure and producing clean Markdown with proper headings, lists, and tables. The downside: it may rephrase or summarize content, so always review the output against the original.
Best for: documents where you want clean, restructured Markdown rather than an exact copy.
Method 4: Online Converters
Several free online tools convert PDF to Markdown in the browser:
- pdf2md.morethan.io — open-source, runs in the browser, no upload to servers
- Aspose PDF to MD — free tier available, handles basic documents
Caution: most online converters upload your file to their servers. If the PDF contains sensitive information, use an offline tool like Marker or Pandoc instead.
Best for: quick one-off conversions of non-sensitive documents.
Method 5: Manual Conversion with a Viewer
For short documents or when you need precise control:
- Open the PDF and a text editor side by side
- Copy the text section by section
- Add Markdown formatting as you go — headings, lists, code blocks, links
- Use a Markdown viewer to check the result as you work
This is slow but gives you the cleanest output. Tools like MDViewer let you preview the Markdown in real time as you write it.
Best for: short documents where accuracy matters more than speed.
Which Method Should You Use?
| Scenario | Recommended Method |
|---|---|
| Complex PDF with tables and images | Marker |
| Simple text document | Pandoc |
| Need restructured, clean output | AI assistant |
| Quick one-off, non-sensitive | Online converter |
| Short document, need precision | Manual |
Viewing the Result
After converting, you’ll want to check that the Markdown renders correctly — especially tables, code blocks, and headings.
MDViewer is a native macOS app that opens .md files instantly from Finder. It renders GitHub Flavored Markdown including tables, task lists, code blocks with syntax highlighting, and Mermaid diagrams. Currently free for early adopters — all features included, no paywalled tiers.
FAQ
Can I convert scanned PDFs to Markdown?
Scanned PDFs contain images, not text. You need OCR (optical character recognition) first. Marker includes built-in OCR. Alternatively, use macOS Preview to run text recognition (Edit > OCR), then convert the result.
Will the conversion preserve my tables?
It depends on the tool. Marker and AI assistants handle tables well. Pandoc and simple online tools often break table formatting. Always check the output.
Can I batch-convert multiple PDFs?
Yes. Marker supports batch conversion out of the box: marker input_dir/ output_dir/. Pandoc can be scripted with a shell loop: for f in *.pdf; do pandoc "$f" -t markdown -o "${f%.pdf}.md"; done
Try MDViewer
MDViewer is currently free for early adopters — all features included. Download it and see if it fits your workflow.
Requires macOS 13.0 or later. Intel and Apple Silicon.