Home / Open Source / anydoc

anydoc

A fast Rust library that converts Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF files into clean, consistent Markdown.

RustMITCrawler
โญ GitHubhttps://github.com/firecrawl/anydoc
15,193
Stars
+0
Star growth
Aug 11, 2026
Last updated
7
Clicks

1. Project Overview

anydoc is a fast, Rust-based library that converts Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF files into clean, consistent GitHub-Flavored Markdown, giving developers and AI agents a single reliable path from any office document to LLM-ready text.

2. Background & Positioning

Built by Firecrawl, anydoc exists to solve a problem that shows up constantly in document-processing and AI pipelines: office files arrive in a dozen legacy and modern formats, and each existing converter only handles a subset of them, often with wildly different output quality and speed. anydoc's core mission is to give every one of those formats โ€” from a .doc saved in 2003 to a .pptx exported yesterday โ€” one shared document model and one Markdown serializer, so a fix to table escaping or heading anchors benefits every format at once instead of being reimplemented format by format.

It differs from general-purpose converters like Pandoc, LibreOffice's headless conversion, or Python tools such as markitdown, unstructured, and docling in three ways: it is pure Rust with no ML models or external services, it detects formats from file content rather than trusting the extension, and โ€” per anydoc's own published benchmark against six competing tools โ€” it was the only one to cover all fourteen tested formats while also scoring highest on quality and converting roughly an order of magnitude faster than the next-fastest tool. anydoc also powers the hosted Firecrawl Parse API, which adds OCR for scanned pages that the open-source library intentionally does not attempt.

3. Feature Categories

๐Ÿ“„ Format Coverage โ€” 8 document families, 20+ extensions
Converts .doc/.docx/.docm (Word), .ppt/.pptx/.pptm/.pps/.ppsx/.ppsm/.pot (PowerPoint), .xls/.xlsx/.xlsm/.xlsb (Excel), .odt/.ods/.odp (OpenDocument), plus .rtf, .epub, .csv, and .pdf. Purpose: give one library that replaces a shelf of single-format converters.

๐Ÿงฑ Document Structure Fidelity โ€” full-fidelity structural elements
Headings with anchors, bold/italic/strikethrough, inline code and code blocks, links and cross-references, nested/numbered/task lists, tables with merged cells, block quotes, footnotes/endnotes, and speaker notes. Purpose: preserve enough structure that the Markdown output is still usable for downstream parsing, not just a text dump.

๐Ÿ–ผ๏ธ Embedded Assets โ€” images and embedded objects
Renders images by alt text in the Markdown while keeping raw bytes and media type available on the underlying document model; external image URLs become normal Markdown image links. Purpose: let callers choose whether to keep, re-host, or discard binary assets.

๐Ÿ”Œ Language Bindings โ€” 4 runtime targets
Native Rust crate, Node.js package (non-blocking via the libuv thread pool), Python package (releases the GIL), and a WebAssembly build for the browser. Purpose: let the same conversion logic run in a backend service, a CLI, a notebook, or fully client-side.

๐Ÿค– Agent Integration โ€” 1 first-class Agent Skill
Ships as an installable Agent Skill (npx skills add firecrawl/anydoc) compatible with Claude Code, Codex, Cursor, OpenCode, and other skill-aware agents. Purpose: let coding agents read office documents they encounter without custom glue code.

4. Key Highlights

  • One document model, one serializer. Every format parses into the same internal Document representation and renders through a single GFM serializer, so formatting bugs are fixed once for all formats instead of once per parser.
  • Content-based format detection. anydoc reads the PDF header, RTF open group, OLE stream names, or ZIP package mimetype from the bytes themselves, so mislabeled or extension-less files still convert correctly (Format::from_bytes).
  • Sub-5ms median conversion. Pure Rust with no ML models or network calls; the published benchmark reports a 4.4ms median conversion time, far faster than LibreOffice, Pandoc, or Python-based alternatives.
  • Independently benchmarked quality leader. Against six other converters over 100 real documents in 14 formats, anydoc was the only tool with full format coverage and the highest quality score on every judged format (LLM-judged against page-rendered ground truth).
  • Built-in PDF support. Text-based PDFs convert locally through the companion pdf-inspector crate โ€” no external OCR service required for that path.
  • Typed, per-variant error handling. A ConvertError enum (Unsupported, Malformed, Encrypted, ResourceLimit, MissingPart, Io) lets calling code distinguish "skip this file" cases from real failures, mirrored as error.code in Node/Wasm and as typed exceptions in Python.

5. Use Cases by Role

  • General developers โ€” Drop anydoc into a document-ingestion pipeline (Rust, Node.js, Python, or browser/WASM) to normalize mixed-format uploads into Markdown without maintaining separate parsers per format.
  • Data / research scientists (and AI/ML engineers) โ€” Use anydoc to turn heterogeneous corpora (reports, slide decks, spreadsheets, CSVs, PDFs) into clean, structurally consistent Markdown suitable for embedding, RAG indexing, or LLM context windows.
  • Project managers / tooling teams โ€” Adopt the Agent Skill so that coding agents (Claude Code, Cursor, Codex, OpenCode) can read design docs, specs, or meeting notes handed to them in native office formats during a session.

6. Getting Started

Find what you need
Check the supported formats table and the per-binding API references (node/README.md, python/README.md, wasm/README.md) to confirm your format and runtime are covered.

Install / integrate

# CLI (no install, runs the prebuilt binary)
npx @firecrawl/anydoc report.docx

# Node.js
npm install @firecrawl/anydoc

# Python
pip install firecrawl-anydoc

# Rust
cargo add anydoc

# Browser / WebAssembly
npm install @firecrawl/anydoc-wasm

Contribute

git clone https://github.com/firecrawl/anydoc.git
cd anydoc
cargo test

Open issues or pull requests directly on the GitHub repository; the project also maintains fixture-based snapshot tests, mutation tests, and cargo-fuzz targets under tests/ and fuzz/ for contributors adding format support.

7. Project Structure

anydoc/
โ”œโ”€โ”€ src/            # Core Rust library: format parsers + document model + GFM serializer
โ”œโ”€โ”€ node/            # Node.js bindings (npm package, TypeScript types)
โ”œโ”€โ”€ python/           # Python bindings (PyPI wheel via maturin)
โ”œโ”€โ”€ wasm/            # WebAssembly / browser bindings
โ”œโ”€โ”€ skills/          # Agent Skill definition (convert-documents-to-markdown)
โ”œโ”€โ”€ bench/            # Speed and quality benchmark harness
โ”œโ”€โ”€ tests/            # Fixture corpus, snapshot and robustness tests
โ”œโ”€โ”€ fuzz/             # cargo-fuzz targets per format
โ”œโ”€โ”€ examples/          # Usage examples
โ””โ”€โ”€ Cargo.toml         # Crate manifest (source of truth for the published version)

src/ holds one parser per format that all funnel into a shared Document model before rendering, which is the architectural core the rest of the repo (bindings, bench, tests) is built around.

8. Related Ecosystem

  • Firecrawl โ€” the parent platform; anydoc's conversion logic powers the hosted Firecrawl Parse API, which adds OCR for scanned/image-only pages.
  • pdf-inspector โ€” the companion Rust crate anydoc uses for local, non-OCR PDF text extraction.
  • Agent Skills โ€” the ecosystem/spec anydoc's Agent Skill is published to, making it discoverable by Claude Code, Codex, Cursor, and OpenCode.
  • Crates.io / npm / PyPI โ€” anydoc publishes official packages as anydoc (crate), @firecrawl/anydoc and @firecrawl/anydoc-wasm (npm), and firecrawl-anydoc (PyPI).

9. License

โœ… Free to use, modify, and distribute, including in commercial and closed-source products (MIT License).
โœ… Free to embed in proprietary pipelines and SaaS products without publishing your own source code.
โŒ No warranty is provided; the authors are not liable for damages arising from use.
โ„น๏ธ The MIT license text and copyright notice must be retained in copies or substantial portions of the software.

10. FAQ

Q: Which document formats does anydoc support?
A: Word (.doc/.docx/.docm), PowerPoint (.ppt/.pptx/.pptm/.pps/.ppsx/.ppsm/.pot), Excel (.xls/.xlsx/.xlsm/.xlsb), OpenDocument (.odt/.ods/.odp), RTF, EPUB, CSV, and PDF.

Q: Does anydoc do OCR for scanned PDFs or images?
A: No โ€” anydoc converts text-based PDFs locally via pdf-inspector but does not include OCR. For scanned documents, the hosted Firecrawl Parse API adds OCR models on top of the same conversion engine.

Q: Can I use anydoc without installing anything?
A: Yes, run npx @firecrawl/anydoc report.docx to convert a file immediately using a prebuilt binary, or try the browser demo, which runs entirely client-side via WebAssembly.

Q: How does anydoc detect the file format?
A: From the file's content, not its extension โ€” reading the PDF header, RTF open group marker, OLE stream names, or ZIP package mimetype/content types. CSV has no such marker, so it relies on the extension or an explicit format argument.

Q: How is anydoc licensed for commercial use?
A: It's MIT licensed, so it can be used freely in commercial and proprietary software; see Section 9 for details.

11. Quick Links

12. Summary

anydoc gives teams a single, fast, dependency-light way to turn Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF files into clean, structurally faithful Markdown โ€” a task that previously required stitching together several format-specific tools of uneven quality. It is best suited for developers building document-ingestion pipelines, data/AI teams preparing corpora for embeddings or LLM context, and coding agents that need to read office documents on the fly, all of whom benefit from its combination of broad format coverage, benchmarked output quality, and millisecond-level conversion speed.