All How-To Guides

4 Ways to Convert Documents with Claude Code

How to convert documents with Claude Code?

4 MCP servers featured

Document conversion between formats like PDF, Word, Markdown, and HTML is a common workflow need. MCP servers provide powerful conversion capabilities that let Claude transform documents while preserving structure and formatting. Here are the best options available.

Recommended MCP Servers

MarkItDown

microsoft/markitdown

>80k

Official Microsoft library that converts PDF, Word, Excel, PowerPoint and more to Markdown for LLM consumption.

Key Features

  • Converts PDF, DOCX, XLSX, PPTX to Markdown
  • Preserves document structure
  • Supports images with OCR
  • Official Microsoft support

Installation

pip install 'markitdown[all]'

MarkItDown is the gold standard for document-to-Markdown conversion. It handles virtually every common format, preserves structure like headings and tables, and is officially maintained by Microsoft. The go-to choice for most conversion needs.

Best for: Converting any document to Markdown View on GitHub

MCP Pandoc

vivekVells/mcp-pandoc

>400

Bidirectional document conversion using Pandoc, supporting Markdown, HTML, PDF, DOCX, EPUB, and LaTeX.

Key Features

  • Bidirectional conversion
  • PDF and DOCX output
  • EPUB and LaTeX support
  • Reference document styling

Installation

pip install mcp-pandoc

MCP Pandoc is the choice when you need to create documents, not just read them. Convert Markdown to PDF, generate Word documents, or create EPUB books. Pandoc's format coverage is unmatched.

Best for: Full bidirectional conversion View on GitHub

Markdownify MCP

zcaceres/markdownify-mcp

>2k

Convert PDFs, images, audio, DOCX, XLSX, PPTX, and web content to Markdown.

Key Features

  • Multi-format to Markdown
  • Image OCR support
  • Audio transcription
  • YouTube transcript extraction

Installation

pnpm install && pnpm run build

Markdownify goes beyond documents to handle images, audio, and video content. If your workflow involves converting diverse media types to text, this all-in-one solution covers everything.

Best for: Mixed media conversion View on GitHub

Fetch MCP (Anthropic)

anthropics/mcp-server-fetch

>2k

Official server for fetching web content and converting HTML pages to Markdown.

Key Features

  • Web page to Markdown
  • Clean content extraction
  • Official Anthropic support
  • Handles most websites

Installation

npx @modelcontextprotocol/server-fetch

The official Fetch MCP cleanly converts web pages to Markdown. When you need to bring web content into your workflow in a format Claude can work with, this is the reliable choice.

Best for: Web pages to Markdown View on GitHub

Quick Comparison

MCPStarsBest ForProsCons
MarkItDown>80kDocs to MarkdownBest format coverageRead-only
MCP Pandoc>400BidirectionalCreates PDFs/DOCXRequires Pandoc
Markdownify>2kMixed mediaAudio/video supportMore setup
Fetch MCP>2kWeb to MarkdownOfficial supportWeb only

Getting Started

To convert documents with Claude Code:

  1. For reading documents, install MarkItDown:

    pip install 'markitdown[all]'
    
  2. For creating PDFs/DOCX, install MCP Pandoc:

    pip install mcp-pandoc
    
  3. For web pages, use the official Fetch MCP.

Example prompt: "Convert this Word document to Markdown and clean up the formatting."

Related Guides