datalab-to/marker

Convert PDF to markdown + JSON quickly with high accuracy

What it solves

Marker converts complex documents—including PDFs, images, PPTX, DOCX, XLSX, HTML, and EPUB files—into clean, structured formats like Markdown, JSON, HTML, and chunks. It specifically addresses the difficulty of extracting structured data from documents that contain tables, mathematical equations, multi-column layouts, and scanned pages, while removing unwanted artifacts like headers and footers.

How it works

Marker uses a hybrid approach to document intelligence. It employs a specialized VLM (Vision Language Model) called Surya for layout detection and OCR. Depending on the configuration, it operates in two primary modes:

  • Balanced Mode: Optimized for GPUs, it uses the VLM for layout and full-page OCR when necessary to ensure the highest quality.
  • Fast Mode: Optimized for CPUs, it prioritizes the text layer and uses the VLM minimally for equations and surgical repairs of garbled text.

For maximum accuracy, users can enable a "Hybrid Mode" by passing an LLM (such as Gemini, Claude, or OpenAI) to refine the output, merge tables across pages, and improve form extraction.

Who it’s for

Marker is designed for developers and data scientists who need to convert large volumes of documents into machine-readable formats for downstream AI tasks, such as RAG (Retrieval-Augmented Generation) or dataset creation, across multiple languages.

Highlights

  • Multi-format support: Handles PDF, images, Office documents, and EPUBs.
  • ** wysokiej jakości extraction**: Accurately formats tables, inline math (LaTeX), and code blocks.
  • Flexible deployment: Runs on GPU, CPU, or Apple Silicon (MPS) using backends like vLLM or llama.cpp.
  • LLM Integration: Optional LLM-based boosting for higher accuracy in complex formatting.
  • Extensible: Allows users to provide custom formatting logic and processors.

Related

  • Project
  • Project
  • Project
  • Project
  • Project