---
id: gh-convert-documents-to-markdown
name: "convert-documents-to-markdown"
url: https://skills.yangsir.net/skill/gh-convert-documents-to-markdown
author: firecrawl
domain: ai-data-management-analysis
tags: ["document-conversion", "markdown", "pdf", "office", "automation"]
install_count: 12300
rating: 4.50 (120 reviews)
github: https://github.com/firecrawl/anydoc/tree/main/skills/convert-documents-to-markdown
---

# convert-documents-to-markdown

> 此技能可将 Word、PPT、Excel、PDF 等常见办公文档一键转换为 GitHub 风格的 Markdown，支持从标准输入读取或输出到文件，适用于需要提取文档内容进行写作、数据整理或知识管理的场景，帮助用户快速将非结构化文档转化为结构化文本。

**Stats**: 12,300 installs · 4.5/5 (120 reviews)

## Before / After 对比

### 文档转换效率对比

**Before**:

在没有这个技能之前，用户手动处理一份PDF或Office文档时，需要打开原始文件、逐段复制内容、手动调整标题和表格格式，再粘贴到Markdown编辑器中。一份10页的报告往往耗时30分钟以上，且容易遗漏或出错。

**After**:

此技能只需一条命令即可将整个文档自动转换为规范的GitHub风格Markdown，几秒钟内完成，格式保持完整，让用户能立即获得干净、结构化的文本，大幅节省时间并避免手动错误。

| Metric | Before | After | Change |
|---|---|---|---|
| 文档转换时间 | 30分钟 | 0.5分钟 | -98% |

## Readme

# Convert documents to Markdown

Run the anydoc CLI. It needs Node 20+ and no install:

```bash
npx -y @firecrawl/anydoc <file>              # Markdown to stdout
npx -y @firecrawl/anydoc <file> -o out.md    # write to a file
npx -y @firecrawl/anydoc - --format csv < f  # read stdin
```

Rules:

1. Supported inputs: `.doc`, `.docx`, `.docm`, `.odt`, `.rtf`, `.epub`, `.pdf`, `.ppt`, `.pps`, `.pot`, `.pptx`, `.pptm`, `.ppsx`, `.ppsm`, `.odp`, `.xls`, `.xlsx`, `.xlsm`, `.xlsb`, `.ods`, `.csv`.
2. The format is detected from the file content. Pass `--format <name>` only when detection cannot work: CSV from stdin, or a missing or wrong extension.
3. Exit codes: 0 success, 1 the document could not be converted, 2 usage error. Failures print one `anydoc: <message>` line to stderr. The CLI never prompts.
4. For a large document, write to a file with `-o` and read the parts you need instead of streaming everything into context.
5. Scanned and image-only PDFs need OCR, which anydoc does not do; they fail as unsupported. The hosted [Firecrawl Parse](https://firecrawl.dev/parse) API handles those.
6. Inside a Node, Python, or Rust codebase, prefer the library over shelling out: `@firecrawl/anydoc` on npm, `firecrawl-anydoc` on PyPI, `anydoc` on crates.io. Each exposes the same `to_markdown` / `toMarkdown` API.


---
*Source: https://skills.yangsir.net/skill/gh-convert-documents-to-markdown*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-convert-documents-to-markdown/markdown*