Marker converts PDFs, images, and Office files into markdown, JSON, chunks, or HTML with layout, tables, math, and optional LLM-assisted cleanup. It runs on GPU, CPU, or Apple MPS via CLI modes.
Overview
Marker turns documents into structured text outputs suitable for search, RAG, or downstream editing. Supported inputs include PDF, images, PPTX, DOCX, XLSX, HTML, and EPUB across languages. It formats tables, forms, equations, inline math, links, references, and code blocks, extracts images, and strips headers and footers by default.
Conversion modes trade accuracy for speed. Balanced mode on GPU routes clean text through fast paths and sends harder pages to a vision model. Fast and no-OCR modes target CPU-only laptops and CI with ONNX layout components. A vllm-style mode runs full-page vision OCR on every page for degraded scans and dense math.
Optional --use_llm pairs Marker with Gemini, Claude, OpenAI-compatible, Azure, Vertex, OpenRouter, or Ollama backends to improve tables, inline math, and form value extraction. Batch commands process folders with worker pools sharing one inference server, and a built-in interactive viewer inspects layout blocks and timings per page.
The tool installs as a Python package with PyTorch and can spawn Surya inference via vLLM on NVIDIA GPUs or llama.cpp on CPU and Apple Silicon. Single-file and batch CLIs support stdout pipelines, page ranges, and multiple output formats for agent workflows.
Key features
- PDF and Office to markdown or JSON
- Table, math, and form handling
- Multiple speed-accuracy modes
- Optional LLM post-processing
- Batch folder conversion
- Interactive layout viewer app
- Image extraction from documents
- CPU, GPU, and MPS inference paths
Use cases
- RAG corpus preparation from PDFs
- Bulk document digitization pipelines
- Agent-friendly markdown extraction
- Local OCR on CPU-only machines