pdftomarkdown

pdftomarkdown

Convert PDFs, Word documents, Excel/CSV files, and YouTube videos into clean, structured Markdown for AI agents, LLMs, and knowledge tools.

Category
Visit Server

README

📄 PDF to Markdown (PDF to MD) — Fast, Private, Open-Source Converter

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).

Live Web App NPM Version GitHub Stars License: MIT 100% In-Browser Privacy AI / MCP Ready


📑 Table of Contents


ðŸŽŊ Why PDF to Markdown?

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:

  1. ðŸĪ– AI & LLM Workflows: Maximizes prompt token density for Claude, ChatGPT, Cursor, and Gemini by stripping layout bloat.
  2. 🗂ïļ Knowledge Management: Effortless importing into Obsidian, Notion, Logseq, Roam, and Apple Notes.
  3. 📝 Technical Documentation: Direct ingestion into static site generators like Docusaurus, VitePress, MkDocs, and Astro.
  4. ðŸŒŋ Git Version Control: Clean line-by-line diffs instead of opaque binary changes.

🏗ïļ Architecture & Conversion Flow

                                  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)

âœĻ Key Features

  • 🔒 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.

🚀 How to Use (3 Ways)

1. Live Web Application (Zero Install)

Visit pdftomarkdown.fyi:

  1. Drag and drop any PDF file.
  2. Click Convert to Markdown.
  3. Preview the rendered document side-by-side and click Copy Markdown or Download .md.

2. Zero-Install CLI (npx)

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"

3. AI Agent & MCP Server (Claude / Cursor)

Equip your AI assistants with PDF to Markdown capabilities with zero coding.

Claude Desktop Configuration:

Add this entry to your claude_desktop_config.json:

{
  "mcpServers": {
    "pdftomarkdown": {
      "command": "npx",
      "args": ["-y", "pdftomarkdown", "--mcp"]
    }
  }
}

Now you can prompt Claude:

"Read whitepaper.pdf and convert it to clean markdown with table of contents."


📊 Benchmark & Comparison Matrix

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) ⚠ïļ Partial ❌ No ⚠ïļ Python only
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

🗂ïļ Supported Formats

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

🛠ïļ CLI Reference & Options

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 documentation

ðŸ’ŧ Programmatic API (Node / TypeScript)

You 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);

🔍 Technical SEO & Performance

  • 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, and FAQPage JSON-LD schemas, sitemap.xml, robots.txt.
  • Zero Client Overhead: No heavy UI frameworks on the parser engine, optimized WebAssembly worker threads.

❓ Frequently Asked Questions (FAQ)

What is PDF to Markdown conversion?

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.

How do I convert PDF to Markdown for free?

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.

Is my document kept private?

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.

Can I convert tables from PDF to Markdown?

Yes. Our engine detects horizontally and vertically aligned text columns and formats them into standard GitHub Flavored Markdown (GFM) pipe tables.

Can I use the output with ChatGPT, Claude, and LLMs?

Yes. Clean Markdown is the optimal input format for AI prompts and RAG vector databases, minimizing token usage while maintaining document hierarchy.


📄 License & Disclaimer

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured