anydoc: Turn Any Office Document into LLM-Ready Markdown in Milliseconds
Meet anydoc, Firecrawl's fast Rust library that converts Word, PowerPoint, Excel, PDF, EPUB, and more into clean GitHub-Flavored Markdown with one consistent output.
Published on • August 5, 2026
AI Assistant

Apple documents are notoriously messy to work with in AI pipelines. Word files, PowerPoint decks, Excel spreadsheets, PDFs, and EPUBs all have different internal structures, and each generally needs its own extraction approach. This is exactly the problem anydoc solves.
Built by Firecrawl, anydoc is a fast Rust library that converts office documents (Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF) into clean GitHub-Flavored Markdown. The headline is speed: single-digit milliseconds per document while keeping one consistent output no matter which format goes in. It even powers Firecrawl’s hosted Parse API, so you can use the same engine online plus their OCR models for scanned pages anydoc can’t read on its own.
The Problem It Solves
Feeding documents to an LLM often means juggling different converters, fighting with layout quirks, and ending up with messy output that wastes tokens and confuses models. anydoc takes a different approach: instead of treating each format as a special case, every format parses into a shared document model and renders through a single Markdown serializer. That means escaping, tables, heading anchors, and footnotes behave identically whether the input was a .doc from 2003 or a .pptx created yesterday.
Getting Started
You can install and use anydoc across every major language.
Agent Skill
anydoc ships as an Agent Skill, so any agent can read documents natively:
npx skills add firecrawl/anydoc
The bundled skill works with Claude Code, Codex, Cursor, OpenCode, and other compatible agents.
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
The first run downloads a prebuilt binary for your platform. You can also npm install -g @firecrawl/anydoc for a permanent command.
Rust
let markdown = anydoc::to_markdown("report.docx")?;
let markdown = anydoc::to_markdown_bytes(&bytes, None)?;
let markdown = anydoc::to_markdown_bytes(&bytes, anydoc::Format::Csv)?;
let document = anydoc::to_document(&bytes, None)?;
Node.js
import { toMarkdown, toMarkdownBytes, toDocument } from '@firecrawl/anydoc';
const markdown = await toMarkdown('report.docx');
const fromBytes = await toMarkdownBytes(bytes);
const fromCsv = await toMarkdownBytes(bytes, 'csv');
const document = await toDocument(bytes);
Python
import anydoc
markdown = anydoc.to_markdown("report.docx")
markdown = anydoc.to_markdown_bytes(data)
markdown = anydoc.to_markdown_bytes(data, "csv")
document = anydoc.to_document(data)
Features Worth Knowing
- One output for every format. Shared document model and serializer mean consistent behavior across all fourteen formats.
- Full document structure. Headings with anchors, styling, code blocks, links, cross-references, lists with the source’s own numbering, tables with merged cells, block quotes, footnotes, and speaker notes.
- Embedded assets. Images render as alt text, with raw bytes preserved on the model and tagged by media type.
- Content-based format detection. The format is read from the bytes themselves (PDF header, RTF open group, OLE stream names, ZIP mimetype), so mislabeled files still convert correctly.
- Fast. Pure Rust with no ML models and no external services; median conversion is under 5ms.
- Bindings that stay out of the way. Node conversion runs on the libuv thread pool; Python releases the GIL.
- PDF support built in. Text-based PDFs convert locally with pdf-inspector, no OCR service required.
How It Performs
anydoc was benchmarked against six other converters on 100 real-world documents spanning fourteen formats, scored 0 to 100 by an LLM judge on completeness, structure, formatting, and cleanliness. It was the only tool to cover all fourteen formats, scored highest on every judged format except EPUB, and converted documents an order of magnitude faster than the next-fastest tool — a median of 4.7ms compared to LibreOffice’s 1129ms.
How It Works
document bytes
├─► format detection → content markers, not the extension
├─► format parser → one per format (doc, docx, ppt, pptx, xls,
│ xlsx, odt/ods/odp, rtf, epub, csv)
│ └─► Document → shared model: blocks, inlines, tables,
│ footnotes, assets
│ └─► GFM serializer → Markdown
└─► PDF → pdf-inspector → Markdown directly
Because every format funnels through the same model and serializer, output quirks are fixed once — a table-escaping fix for docx is automatically a fix for rtf, odt, and everything else.
Final Thoughts
If your pipeline receives a mixed bag of office documents and needs one consistent, structured Markdown output, anydoc is an excellent fit. It is open source under the MIT license, and it demonstrates how a well-architected shared model can tame the chaos of dozens of document formats. For AI applications that need to read the world’s files, tools like this make the data clean, fast, and LLM-ready.