Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
anydoc

anydoc

> 编程语言
Free

Convert Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF to clean Markdown. Built in R

20.9K stars0 likes3 views
WebsiteGitHub

About

Convert Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF to clean Markdown. Built in R

anydoc

Fast Rust library that converts documents (Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF) into clean GitHub-Flavored Markdown. Includes bindings for Node.js, Python, and the browser (WebAssembly).

Built by Firecrawl to turn any office document into LLM-ready Markdown in single-digit milliseconds, with one consistent output no matter which format goes in. It powers Firecrawl Parse, so if you'd rather not run it yourself, the hosted API gives you the same conversion plus our OCR models for the scanned pages anydoc can't read on its own.

Try it in your browser: the demo page runs the library as WebAssembly, so files are converted locally and never leave your machine.

Quick start

Agent skill

anydoc ships as an Agent Skill, so your agent can read any document it runs into:

npx skills add firecrawl/anydoc

The skill teaches the agent to convert documents with the anydoc CLI. Works with Claude Code, Codex, Cursor, OpenCode, and any other compatible agent.

CLI

npx @firecrawl/anydoc report.docx               # Markdown to stdout
npx @firecrawl/anydoc slides.pptx -o slides.md  # or to a file
npx @firecrawl/anydoc - --format csv < data.csv # read stdin
npx @firecrawl/anydoc scan.pdf --ocr hosted     # scanned pages via Firecrawl Parse

npx downloads the prebuilt binary for your platform on first run. For a permanent anydoc command, install globally with npm install -g @firecrawl/anydoc. Run anydoc --help for all options.

Node.js

npm install @firecrawl/anydoc
import { toDocument, toMarkdown, toMarkdownBytes } from '@firecrawl/anydoc';

// From a file path:
const markdown = await toMarkdown('report.docx');

// To enable OCR:
const markdown = await toMarkdown('report.docx', { ocr: 'hosted' );

// From bytes, with the format detected from the content:
const fromBytes = await toMarkdownBytes(bytes);

// Or name it, which signature-less formats (CSV) need:
const fromCsv = await toMarkdownBytes(bytes, 'csv');

// Or stop at the document model, which also carries embedded assets:
const document = await toDocument(bytes);

Full API reference: node/README.md

Python

pip install firecrawl-anydoc
import anydoc

# From a file path:
markdown = anydoc.to_markdown("report.docx")

# To enable OCR:
markdown = anydoc.to_markdown("report.docx", ocr="hosted")

# From bytes, with the format detected from the content:
markdown = anydoc.to_markdown_bytes(data)

# Or name it, which signature-less formats (CSV) need:
markdown = anydoc.to_markdown_bytes(data, "csv")

# Or stop at the document model, which also carries embedded assets:
document = anydoc.to_document(data)

Full API reference: python/README.md

Browser (WebAssembly)

npm install @firecrawl/anydoc-wasm
import init, { toMarkdownBytes, toDocument } from '@firecrawl/anydoc-wasm';

await init();

// From bytes, with the format detected from the content:
const markdown = toMarkdownBytes(bytes);

// Or name it, which signature-less formats (CSV) need:
const fromCsv = toMarkdownBytes(bytes, 'csv');

// Or stop at the document model, which also carries embedded assets:
const document = toDocument(bytes);

Full API reference: wasm/README.md

Rust

cargo add anydoc
// From a file path:
let markdown = anydoc::to_markdown("report.docx")?;

// From bytes, with the format detected from the content:
let markdown = anydoc::to_markdown_bytes(&bytes, None)?;

// Or name it, which signature-less formats (CSV) need:
let markdown = anydoc::to_markdown_bytes(&bytes, anydoc::Format::Csv)?;

// Or stop at the document model, which also carries embedded assets:
let document = anydoc::to_document(&bytes, None)?;

OCR

anydoc reads text-based PDFs locally but does no OCR, so a PDF with scanned or image-only pages fails with NeedsOcr. Opt in and those documents go to Firecrawl Parse, which OCRs them and returns the same Markdown. No signup needed; set FIRECRAWL_API_KEY for higher limits.

Opt in Key, else FIRECRAWL_API_KEY CLI anydoc scan.pdf --ocr hosted --api-key <key> Node toMarkdown('scan.pdf', { ocr: 'hosted' }) apiKey Python anydoc.to_markdown("scan.pdf", ocr="hosted") api_key

Only documents that need OCR leave the machine, and the whole document goes, since Parse has no page selection. If Parse cannot convert it, Node rejects with code: 'hosted' and Python raises HostedError. --api-url, apiUrl and api_url, else FIRECRAWL_API_URL, point at another Parse deployment. The Rust crate has no ocr option and never makes network calls.

Features

  • One output for every format. Each format parses into a shared document model and renders through a single Markdown serializer, so escaping, tables, heading anchors, and footnotes behave identically whether the input was a .doc from 2003 or a .pptx from yesterday.
  • Full document structure. Headings with anchors, bold/italic/strikethrough, inline code and code blocks, links and internal cross-references, bulleted/numbered/nested/task lists with the source's own numbering, tables with merged cells and header rows, block quotes, footnotes and endnotes, and speaker notes.
  • Equations as LaTeX. Word and PowerPoint (OMML), OpenDocument and EPUB (MathML), and RTF equations convert to GitHub-flavored math: $...$ inline and $$ blocks.
  • Embedded assets. Images and embedded objects render as their alt text in the Markdown, and the raw bytes stay available on the document model, tagged with their media type. Images with an external URL become ordinary Markdown images.
  • Content-based format detection. The format is read from the bytes themselves (PDF header, RTF open group, OLE stream names, ZIP package mimetype), so mislabeled files still convert correctly.
  • Fast. Pure Rust, no ML models, no external services. Median conversion time is under 5ms per document.
  • Bindings that stay out of the way. Node.js conversion runs on the libuv thread pool and never blocks the event loop; Python releases the GIL so other threads keep running. TypeScript types and Python stubs ship with the packages.
  • PDF support built in. Text-based PDFs convert locally through pdf-inspector, no OCR service required. Scanned pages can opt into hosted OCR.
  • Agent ready. Ships as an Agent Skill: one npx skills add firecrawl/anydoc and any agent can read office documents.

Supported formats

Format Extensions Word .doc, .docx, .docm PowerPoint .ppt, .pps, .pot, .pptx, .pptm, .ppsx, .ppsm Excel .xls, .xlsx, .xlsm, .xlsb OpenDocument .odt, .ods, .odp Rich Text Format .rtf EPUB .epub CSV .csv PDF .pdf

Benchmark

anydoc is measured against six other converters on 100 real-world documents spanning fourteen formats. Scores run from 0 to 100, higher is better; speed is the median time to convert one document.

tool formats median ms docs judged score completeness structure formatting cleanliness anydoc 14/14 4.4 94 81 87 79 78 81 libreoffice 12/14 1129.5 87 40 59 42 40 24 unstructured 8/14 572.9 58 63 76 59 51 63 markitdown 6/14 134.8 33 65 78 66 60 52 pandoc 5/14 102.1 34 56 74 57 56 38 docling 4/14 513.6 21 57 60 60 57 51 mammoth 1/14 52.5 8 70 84 71 75 51

Per format, like for like:

format anydoc libreoffice unstructured markitdown pandoc docling mammoth doc 87 57 67 - - - - docm 84 48 - - - - - docx 88 56 53 71 68 71 70 epub 77 - 72 72 52 - - odp 86 23 - - - - - ods 82 38 - - - - - odt 80 51 68 - 60 - - ppt 80 26 - - - - - pptx 74 24 - 66 - 52 - rtf 88 53 46 - 45 - - xls 80 38 66 62 - - - xlsm 76 32 - - - - - xlsx 72 30 66 55 - 47 -

How quality was scored: an LLM judge (Claude Sonnet 5) compares two tools' outputs blind against ground truth: the document's first six pages, rendered to images by LibreOffice. Each output is scored on completeness, structure, formatting, and cleanliness. Every pair is judged twice with the outputs swapped to cancel position bias, for 482 verdicts in total. Each tool's score averages its per-format scores over the formats it supports, so a corpus heavy in one format can't skew it. It also means each row averages a different set of formats (mammoth's 69 is docx alone, while anydoc's 81 spans all fourteen), so the per-format table is the fair comparison.

Speed is one warm conversion per document on a Ryzen 9 9950X3D (Windows 11, 64 GB DDR5-6400). anydoc and the Python libraries are timed with process spawn excluded; the CLI tools include it, since that is how they are used. The harness lives in bench/; the corpus is not redistributable and is not in the repo.

Best fit: pipelines that receive a mixed bag of office documents and need one consistent, structured Markdown output. In this comparison, anydoc was the only tool to cover all fourteen formats, scored highest on every judged

GitHub Issues· 93 open

View all on GitHub
  • #170

    anydoc-wasm still ships pdf-inspector 1.14.2 — the RTL extraction fix (pdf-inspector#440) isn't included

    Updated Sep 15, 2026
  • #173

    Multi-column tables collapse into unreadable single-column blobs during PDF conversion

    Updated Sep 12, 2026
  • #172

    Ligature characters (fi/fl/ffi) are dropped instead of expanded when extracting PDF text

    Updated Sep 12, 2026
  • #167

    OOXML: recoverable allocation failure in Package::part is classified as malformed

    Updated Sep 9, 2026

Highlights

  • •Equations as LaTeX. Word and PowerPoint (OMML), OpenDocument and EPUB (MathML), and RTF equations convert to GitHub-flavored math: $...$ inline and $$ blocks.
  • •Fast. Pure Rust, no ML models, no external services. Median conversion time is under 5ms per document.
  • •PDF support built in. Text-based PDFs convert locally through pdf-inspector, no OCR service required. Scanned pages can opt into hosted OCR.
  • •Agent ready. Ships as an Agent Skill: one npx skills add firecrawl/anydoc and any agent can read office documents.

> Tags

开发者工具

No comments yet. Be the first to share.

> Details

PublishedSep 9, 2026
UpdatedSep 17, 2026
Category编程语言
PricingFree

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言