Skip to content

Zerox

Converts documents to Markdown by sending page images to vision AI models.

Stars
12.3k
Forks
841
Licence
MIT
Language
TypeScript
Last update
1.5 years ago
Type
Library

No commits in over a year — check for forks or alternatives before adopting.

What it is

Zerox is a Node.js and Python package that turns documents such as PDFs, DOCX files and images into Markdown. It converts each page into an image, sends each image to a vision model like GPT-4o and asks for Markdown, then joins the results. The README says this approach handles unusual layouts, tables and charts better than traditional text extraction, which makes it useful for preparing documents for AI systems.

  • Convert a multi-page PDF into a single Markdown file using the zerox function
  • Extract structured fields from invoices or forms by setting extractOnly and a schema
  • Process only selected pages with pagesToConvertAsImages
  • Save the combined result.md to an output directory with outputDir

Great for

  • Developers building pipelines that feed documents into AI or search systems
  • Teams with PDFs containing tables, charts or unusual layouts
  • Users who already have API access to OpenAI, Azure OpenAI, AWS Bedrock or Google Gemini models
  • Projects that need structured data pulled from documents using a JSON Schema

Not ideal for

  • People who need a no-code tool: the README describes an SDK used in code, and the hosted demo is the only non-coding option mentioned
  • Users who want to avoid per-page model API costs, since every page is sent to a paid vision model
  • High-volume or offline processing, because the README does not describe local or offline models
Step-by-step guide: how to use ZeroxInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js (for the Node package) · GraphicsMagick and Ghostscript (for PDF processing in Node) · Python with Poppler (for the Python package) · An API key for a supported model provider such as OpenAI

    Install the Node package

    npm install zerox

    Install GraphicsMagick on Linux

    sudo apt-get install -y graphicsmagick
  2. 2

    Run it

    • Install the zerox package with npm
    • Install GraphicsMagick if the automatic install did not work
    • Set your OPENAI_API_KEY environment variable
    • Call zerox with a filePath and credentials.apiKey and read the returned pages
  3. 3

    Get the most out of it

    • Set maintainFormat to true when tables run across pages, noting it is slower because requests run in sequence
    • Use concurrency to process several pages at once
    • Use extractOnly with a schema and extractPerPage for structured output
    • Choose a different extraction model with extractionModel and related options
    • Use pagesToConvertAsImages to limit cost and time on large documents

Downloads

Strengths

  • Simple, short API for turning a file into Markdown
  • Supports several model providers, including OpenAI, Azure OpenAI, AWS Bedrock and Google Gemini
  • Offers options for structured extraction, per-page processing, concurrency and error handling

Trade-offs

  • Requires external system tools (GraphicsMagick and Ghostscript for Node, Poppler for Python) and a paid model API key
  • Sends document page images to third-party model providers, so privacy depends on that provider
  • The README is truncated, so some model lists and details could not be fully verified

How it compares

ProjectStarsTypeLevelUpdatedBest for
zerox (this)12.3kLibraryintermediate1.5 years agoDevelopers building pipelines that feed documents into AI or search systems
docling70kLibrarybeginner5 days agoPython developers building retrieval or RAG pipelines over PDFs and office files
markitdown193kLibrarybeginner9 days agoDevelopers building LLM or text analysis pipelines that need document text
pdf-inspector19.8kLibraryintermediate15 days agoDevelopers building pipelines that process many PDFs and need to route scanned ones to OCR
pdfplumber10.9kLibrarybeginner23 days agoPython developers pulling tables or text out of machine-generated PDFs
Umi-OCR48.4kAppbeginner12 months agoPeople who need to copy text out of screenshots or scanned pages

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.