跪拜 Guibai
← All articles
Backend · Java · Programmer

Firecrawl's anydoc: Zero-OCR Rust Library Turns Word, PPT, Excel into Markdown

By SimonKing ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Document-to-Markdown conversion has long carried a hidden OCR tax: packaging Tesseract, configuring Chinese font packs, or paying per-page cloud APIs. anydoc removes that entire dependency class for knowledge-base pipelines, making local, offline, high-speed conversion the default and reserving OCR for the rare scanned page.

Summary

anydoc from Firecrawl is a pure Rust library that parses 14 document formats into a unified Document intermediate model and serializes them to GitHub-Flavored Markdown. It is MIT-licensed and powers Firecrawl's Parse engine. The key selling point is zero OCR dependency: no ML models are loaded, no network calls are made, and no per-page fees apply. Format detection uses byte content markers rather than file extensions, so even misnamed files convert correctly.

The library is available across stacks: a CLI via npx, Node.js bindings with TypeScript types, a Python package that releases the GIL during conversion, a WASM build for fully in-browser conversion, and a Rust crate that never makes network requests. OCR is strictly opt-in via a hosted flag or parse_mode. The WASM version is synchronous, unlike the Node version. Additionally, an agent skill lets AI coding assistants convert documents on demand, following the agentskills.io protocol.

Official benchmarks across 100 real documents in 14 formats report a median conversion time of 4.4ms and a quality score of 81, both first among tools tested, versus LibreOffice at 1129.5ms, pandoc at 102.1ms, and markitdown at 134.8ms. The benchmarks are self-tested with a non-public corpus and an LLM judge, so the order-of-magnitude speed advantage is credible but not a rigorous independent comparison.

Takeaways
— anydoc is a pure Rust, MIT-licensed library by Firecrawl that converts 14 document formats to GitHub-Flavored Markdown.
— It loads no ML models, makes no network calls, and requires no external services; OCR is opt-in via a hosted flag or parse_mode.
— Supported formats include .doc/.docx/.docm, .ppt/.pps/.pot/.pptx/.pptm/.ppsx/.ppsm, .xls/.xlsx/.xlsm/.xlsb, .odt/.ods/.odp, .rtf, .epub, .csv, and .pdf.
— All formats parse into a shared Document intermediate model (blocks, inlines, tables, footnotes, assets), so serialization fixes benefit every format.
— PDF conversion uses Firecrawl's separate pdf-inspector path.
— Format detection is based on magic byte markers, not file extensions; misnamed files still convert correctly.
— Official benchmarks on 100 real documents report a median 4.4ms conversion time and a quality score of 81, compared to LibreOffice 1129.5ms, pandoc 102.1ms, and markitdown 134.8ms (self-tested, corpus not public, LLM judge).
— Installation is available via npx CLI, npm for Node.js, pip for Python, cargo for Rust, and an npm WASM package; the WASM build is synchronous and runs fully in the browser.
— The Rust crate deliberately has no OCR option and never initiates network requests.
— An agent skill is installed with 'npx skills add firecrawl/anydoc' and works with Claude Code, Codex, Cursor, OpenCode, and other clients following agentskills.io.
Conclusions

The zero-OCR stance attacks a pain point that has silently inflated the cost of document conversion: installing Tesseract, tuning Chinese font packages, or paying per-page cloud OCR fees.

A unified Document intermediate model means a single serialization fix applies to all 14 formats, a design that keeps maintenance manageable across many Office dialects.

The benchmark numbers are self-reported and judged by an LLM, but the order-of-magnitude speed gap over LibreOffice, pandoc, and markitdown is too large to attribute to measurement artifacts.

Concepts & terms
GFM Markdown
GitHub Flavored Markdown, an extended Markdown specification that adds tables, strikethrough, task lists, and other syntax used across GitHub and many developer tools.
Document intermediate model
anydoc's unified internal representation of a parsed document, composed of blocks, inlines, tables, footnotes, and assets, which is then serialized to Markdown consistently across formats.
agentskills.io
An open protocol for defining AI agent skills, compatible with clients like Claude Code, Codex, Cursor, and OpenCode, enabling agents to perform specific tasks such as document conversion.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗