The ultimate open-source PDF to Markdown converter for Humans, Developers, and AI Agents.
Effortlessly convert PDFs, Word (.docx), Excel & CSVs (.xlsx,.csv), and YouTube URLs into clean, structured, token-efficient Markdown (.md).
- Why PDF to Markdown?
- Architecture & Conversion Flow
- Key Features
- How to Use (3 Ways)
- Benchmark & Comparison Matrix
- Supported Formats
- CLI Reference & Options
- Programmatic API (Node / TypeScript)
- Technical SEO & Performance
- Frequently Asked Questions (FAQ)
- License
PDFs are designed for visual printing, not editing or AI computing. They trap content inside fixed-coordinate binary blobs. Markdown (.md) is the universal standard for:
- π€ AI & LLM Workflows: Maximizes prompt token density for Claude, ChatGPT, Cursor, and Gemini by stripping layout bloat.
- ποΈ Knowledge Management: Effortless importing into Obsidian, Notion, Logseq, Roam, and Apple Notes.
- π Technical Documentation: Direct ingestion into static site generators like Docusaurus, VitePress, MkDocs, and Astro.
- πΏ Git Version Control: Clean line-by-line diffs instead of opaque binary changes.
INPUT SOURCE
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
βΌ βΌ βΌ
π PDF Document π Word / Excel π₯ YouTube Link
(Local / Remote URL) (.docx, .xlsx, .csv) (Video URL / Shorts)
β β β
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Unified Geometric & NLP Engine β
ββββββββββββββββββββββββββββββββββββββββ€
β β’ Visual Reading Order Sorter β
β β’ H1βH4 Typography Hierarchy β
β β’ GFM Table Reconstructor β
β β’ Code Block & List Parser β
β β’ Link & Metadata Extractor β
ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
CLEAN MARKDOWN
ββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββ
βΌ βΌ βΌ
π Web UI Workspace π» CLI Output Stream π€ AI Agent Context
(Split Editor + Preview) (stdout / .md file export) (Claude / Cursor MCP)
- π 100% In-Browser Privacy: In the web app, documents are converted locally in memory via WebAssembly / JavaScript. Zero files are uploaded to any external server.
- β‘ Zero-Install CLI (
npx): Convert any PDF, Word doc, or CSV straight from your command line with no setup. - π Smart Table Detection: Automatically aligns multi-column rows into clean GitHub Flavored Markdown (GFM) pipe tables (
| Header | ... |). - ποΈ Multi-Format Extensibility: Converts PDFs, Word (
.docx), Excel/CSVs (.csv), and YouTube videos into Markdown. - π€ Native Model Context Protocol (MCP) Server: Connect directly to Claude Desktop, Cursor, Windsurf, and Antigravity with zero coding.
- π¨ Minimalist Dual-Panel Workspace: Live side-by-side raw Markdown editor and rendered HTML preview with line, word, and character counters.
- π Blazing Fast: Converts standard multi-page documents in milliseconds without requiring heavy GPUs or multi-gigabyte models.
Visit pdftomarkdown.fyi:
- Drag and drop any PDF file.
- Click Convert to Markdown.
- Preview the rendered document side-by-side and click Copy Markdown or Download .md.
No installation required. Run directly in your terminal:
# Convert a local PDF file
npx pdftomarkdown research-paper.pdf -o paper.md
# Convert a Word document (.docx)
npx pdftomarkdown document.docx -o doc.md
# Convert a CSV table to GFM pipe tables
npx pdftomarkdown financials.csv -o financials.md
# Extract timestamped transcript from a YouTube video
npx pdftomarkdown "https://www.youtube.com/watch?v=dQw4w9WgXcQ" > video.md
# Convert with an automatic Table of Contents
npx pdftomarkdown manual.pdf --toc -o manual.md
# Pipe directly into an AI tool / LLM
cat quarterly-report.pdf | npx pdftomarkdown | llm "Summarize the key takeaways"Equip your AI assistants with PDF to Markdown capabilities with zero coding.
Add this entry to your claude_desktop_config.json:
{
"mcpServers": {
"pdftomarkdown": {
"command": "npx",
"args": ["-y", "pdftomarkdown", "--mcp"]
}
}
}Now you can prompt Claude:
"Read
whitepaper.pdfand convert it to clean markdown with table of contents."
| Capability | pdftomarkdown | PSPDFKit | Marker | Microsoft MarkItDown |
|---|---|---|---|---|
| Instant Live Web App | β Yes (pdftomarkdown.fyi) | β No | β No | β No |
| 100% In-Browser Privacy | β Yes (0 uploads) | β No | β No | β No |
Zero-Install CLI (npx) |
β Yes | β Yes | β (Heavy Python) | β (Python pip) |
| Live Rendered Preview | β Yes (Side-by-side) | β No | β No | β No |
Word (.docx) to MD |
β Yes | β No | β No | β Yes |
| Excel / CSV to GFM Table | β Yes | β No | β No | β Yes |
| YouTube Video to Transcript | β Yes | β No | β No | β Yes |
| Model Context Protocol (MCP) | β Yes (Built-in) | β No | ||
| Execution Speed | β‘ < 200 ms / page | β‘ < 200 ms / page | π’ 5β20 s (GPU) | β‘ < 500 ms / page |
| Hardware Overhead | πͺΆ Featherweight (JS) | πͺΆ Featherweight | π Giant (10GB+ PyTorch) | π Python Env |
| Format | Extension | Output Style |
|---|---|---|
| PDF Documents | .pdf |
Headings (H1βH4), lists, GFM tables, links, code blocks |
| Word Documents | .docx |
Headings, bold/italic, bullet lists, clean links |
| Excel & CSV | .csv, .tsv, .xlsx |
GitHub Flavored Markdown (GFM) pipe tables |
| YouTube URLs | https://youtube.com/... |
Timestamped transcript (00:00), description, and metadata |
| Plain Text & Code | .txt, .json, .xml |
Formatted code fences & readable Markdown blocks |
pdftomarkdown β The universal document to Markdown converter.
Usage:
npx pdftomarkdown <file-or-url> [options]
Options:
-o, --output <file> Write output directly to a file (.md)
--toc Automatically generate a Table of Contents
--no-tables Disable automatic GFM table detection
--mcp Start Model Context Protocol (MCP) server
-v, --version Show current version
-h, --help Show help documentationYou can import and use the converter directly inside your Node.js or TypeScript projects:
import { convertPdfToMarkdown, convertAnyToMarkdown } from 'pdftomarkdown';
// Convert a PDF buffer or file
const markdown = await convertPdfToMarkdown(pdfBuffer, {
includeToc: true,
detectTables: true,
preservePageBreaks: true,
});
console.log(markdown);- Primary Keywords: PDF to Markdown, PDF to MD, PDF to Markdown converter, convert PDF to Markdown.
- Secondary Keywords: PDF to Markdown online, free PDF to Markdown converter, convert PDF file to Markdown, extract Markdown from PDF, Word to Markdown, YouTube to Markdown.
- Technical Standards: Semantic HTML5, Schema.org
WebSite,WebApplication, andFAQPageJSON-LD schemas, sitemap.xml, robots.txt. - Zero Client Overhead: No heavy UI frameworks on the parser engine, optimized WebAssembly worker threads.
PDF to Markdown conversion parses the geometry, fonts, and text positions inside fixed-layout PDF files and translates them into plain-text Markdown (.md) format, preserving headings, lists, tables, and links.
You can use the live web app at pdftomarkdown.fyi or run npx pdftomarkdown input.pdf -o output.md in your terminal. Both are 100% free with no registration or subscriptions.
Yes. When using the web app, all parsing occurs locally in your browser's memory. No files or text streams are ever sent to our servers.
Yes. Our engine detects horizontally and vertically aligned text columns and formats them into standard GitHub Flavored Markdown (GFM) pipe tables.
Yes. Clean Markdown is the optimal input format for AI prompts and RAG vector databases, minimizing token usage while maintaining document hierarchy.
Distributed under the MIT License. See LICENSE for more information.
Disclaimer: All product names, logos, and brands (including Microsoft, PSPDFKit/Nutrient, Marker, Claude, and ChatGPT) are property of their respective owners and are used here solely for identification, compatibility, and comparative purposes.
Copyright Β© 2026 PDF to Markdown